home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / ng / ngperl10 / src / commands.dat < prev    next >
Encoding:
Text File  |  1993-02-27  |  123.5 KB  |  4,064 lines

  1. nstrate the GetImage and PutImage commands }
  2.  
  3. const
  4.   r  = 20;
  5.   StartX = 100;
  6.   StartY = 50;
  7.  
  8. var
  9.   CurPort : ViewPortType;
  10.  
  11. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  12. var
  13.   Step : integer;
  14. begin
  15.   Step := Random(2*r);
  16.   if Odd(Step) then
  17.     Step := -Step;
  18.   X := X + Step;
  19.   Step := Random(r);
  20.   if Odd(Step) then
  21.     Step := -Step;
  22.   Y := Y + Step;
  23.  
  24.   { Make saucer bounce off viewport walls }
  25.   with CurPort do
  26.   begin
  27.     if (x1 + X + Width - 1 > x2) then
  28.       X := x2-x1 - Width + 1
  29.     else
  30.       if (X < 0) then
  31.         X := 0;
  32.     if (y1 + Y + Height - 1 > y2) then
  33.       Y := y2-y1 - Height + 1
  34.     else
  35.       if (Y < 0) then
  36.         Y := 0;
  37.   end;
  38. end; { MoveSaucer }
  39.  
  40. var
  41.   Pausetime : word;
  42.   Saucer    : pointer;
  43.   X, Y      : integer;
  44.   ulx, uly  : word;
  45.   lrx, lry  : word;
  46.   Size      : word;
  47.   I         : word;
  48. begin
  49.   ClearDevice;
  50.   FullPort;
  51.  
  52.   { PaintScreen }
  53.   ClearDevice;
  54.   MainWindow('GetImage / PutImage Demonstration');
  55.   StatusLine('Esc aborts or press a key...');
  56.   GetViewSettings(CurPort);
  57.  
  58.   { DrawSaucer }
  59.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  60.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  61.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  62.   Circle(StartX+10, StartY-12, 2);
  63.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  64.   Circle(StartX-10, StartY-12, 2);
  65.   SetFillStyle(SolidFill, MaxColor);
  66.   FloodFill(StartX+1, StartY+4, GetColor);
  67.  
  68.   { ReadSaucerImage }
  69.   ulx := StartX-(r+1);
  70.   uly := StartY-14;
  71.   lrx := StartX+(r+1);
  72.   lry := StartY+(r div 3)+3;
  73.  
  74.   Size := ImageSize(ulx, uly, lrx, lry);
  75.   GetMem(Saucer, Size);
  76.   GetImage(ulx, uly, lrx, lry, Saucer^);
  77. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  78.  
  79.   { Plot some "stars" }
  80.   for I := 1 to 1000 do
  81.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  82.   X := MaxX div 2;
  83.   Y := MaxY div 2;
  84.   PauseTime := 70;
  85.  
  86.   { Move the saucer around }
  87.   repeat
  88. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  89.      Delay(PauseTime);
  90. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  91.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  92.   until KeyPressed;
  93.   FreeMem(Saucer, size);
  94.   WaitToGo;
  95. end; { PutImagePlay }
  96.  
  97. procedure PolyPlay;
  98. { Draw random polygons with random fill styles on the screen }
  99. const
  100.   MaxPts = 5;
  101. type
  102.   PolygonType = array[1..MaxPts] of PointType;
  103. var
  104.   Poly : PolygonType;
  105.   I, Color : word;
  106. begin
  107.   MainWindow('FillPoly demonstration');
  108.   StatusLine('Esc aborts or press a key...');
  109.   repeat
  110.     Color := RandColor;
  111.     SetFillStyle(Random(11)+1, Color);
  112.     SetColor(Color);
  113.     for I := 1 to MaxPts do
  114.       with Poly[I] do
  115.       begin
  116.         X := Random(MaxX);
  117.         Y := Random(MaxY);
  118.       end;
  119.     FillPoly(MaxPts, Poly);
  120.   until KeyPressed;
  121.   WaitToGo;
  122. end; { PolyPlay }
  123.  
  124. procedure FillStylePlay;
  125. { Display all of the predefined fill styles available }
  126. var
  127.   Style    : word;
  128.   Width    : word;
  129.   Height   : word;
  130.   X, Y     : word;
  131.   I, J     : word;
  132.   ViewInfo : ViewPortType;
  133.  
  134. procedure DrawBox(X, Y : word);
  135. begin
  136.   SetFillStyle(Style, MaxColor);
  137.   with ViewInfo do
  138.     Bar(X, Y, X+Width, Y+Height);
  139.   Rectangle(X, Y, X+Width, Y+Height);
  140.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  141.   Inc(Style);
  142. end; { DrawBox }
  143.  
  144. begin
  145.   MainWindow('Pre-defined fill styles');
  146.   GetViewSettings(ViewInfo);
  147.   with ViewInfo do
  148.   begin
  149.     Width := 2 * ((x2+1) div 13);
  150.     Height := 2 * ((y2-10) div 10);
  151.   end;
  152.   X := Width div 2;
  153.   Y := Height div 2;
  154.   Style := 0;
  155.   for J := 1 to 3 do
  156.   begin
  157.     for I := 1 to 4 do
  158.     begin
  159.       DrawBox(X, Y);
  160.       Inc(X, (Width div 2) * 3);
  161.     end;
  162.     X := Width div 2;
  163.     Inc(Y, (Height div 2) * 3);
  164.   end;
  165.   SetTextJustify(LeftText, TopText);
  166.   WaitToGo;
  167. end; { FillStylePlay }
  168.  
  169. procedure FillPatternPlay;
  170. { Display some user defined fill patterns }
  171. const
  172.   Patterns : array[0..11] of FillPatternType = (
  173.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  174.             OldColor which has a path of pixels of OldColor or NewColor
  175.             with sides touching back to the seed point, (XSeed, YSeed).
  176.             Therefore, only pixels of OldColor are modified and no other
  177.             information is changed.
  178.  
  179.             SEE ALSO
  180.  
  181.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  182.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  183.             SETVIEW
  184.  
  185.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  186.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  187.             IF WHICHVGA = 0 THEN STOP
  188.             DUMMY=RES640
  189.             SETVIEW 100, 100, 539, 379
  190.             FILLVIEW 10
  191.             WHILE INKEY$ = ""
  192.             WEND
  193.             VIDEOMODESET VMODE
  194.             END
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.                                                                          63
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.           FONTGETINFO
  219.  
  220.             PROTOTYPE
  221.  
  222.             SUB FONTGETINFO (Width%, Height%)
  223.  
  224.             INPUT
  225.  
  226.             no input parameters
  227.     WEND
  228.             MOUSEEXIT
  229.             VIDEOMODESET VMODE
  230.             END
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.                                                                          86
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.           MOUSECURSORDEFAULT
  279.  
  280.             PROTOTYPE
  281.  
  282.             SUB MOUSECURSORDEFAULT ()
  283.  
  284.             INPUT
  285.  
  286.             no input parameters
  287.  
  288.             OUTPUT
  289.  
  290.             no value returned
  291.  
  292.             USAGE
  293.  
  294.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  295.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  296. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  297. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  298. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  299. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  300. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  301. $╤
  302. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  303. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  304. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  305. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  306. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  307. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  308. ░£▒
  309. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  310. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  311.       end;
  312.     end;
  313.   end;
  314.   WaitToGo;
  315. end; { UserLineStylePlay }
  316.  
  317.  
  318. procedure SayGoodbye;
  319. { Say goodbye and then exit the program }
  320. var
  321.   ViewInfo : ViewPortType;
  322. begin
  323.   MainWindow('');
  324.   GetViewSettings(ViewInfo);
  325.   SetTextStyle(TriplexFont, HorizDir, 4);
  326.   SetTextJustify(CenterText, CenterText);
  327.   with ViewInfo do
  328.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  329.   StatusLine('Press any key to quit...');
  330.   repeat until KeyPressed;
  331. end; { SayGoodbye }
  332.  
  333.  
  334. PROCEDURE SelectMode;
  335. VAR
  336.     choice1,choice2     : CHAR;
  337.    xsize,ysize            : WORD;
  338. BEGIN
  339.     (* Let's select a mode *)
  340.     ClrScr;
  341.     WriteLn('VESADEMO:');
  342.     WriteLn('1. 256 colors');
  343.     WriteLn('2. 32768 colors');
  344.     WriteLn('3. 65536 colors');
  345.     WriteLn('4. 16777216 colors');
  346.     WriteLn('Q uit');
  347.     WriteLn;
  348.     Write('Your choice: ');
  349.     REPEAT
  350.         ReadLn(choice1);
  351.       IF choice1 <> '1' THEN BEGIN
  352.           WriteLn('Sorry !');
  353.          WriteLn('This demo wasn''t written for more as 256 colors !');
  354.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  355.          WriteLn('Switching to 256 colors.');
  356.          choice1 := '1';
  357.       END;
  358.     UNTIL choice1 IN ['1'..'4','q'];
  359.     IF choice1 = 'q' THEN Halt;
  360.  
  361.     WriteLn;
  362.     WriteLn;
  363.     WriteLn('a. 320x200');
  364.     WriteLn('b. 640x480');
  365.     WriteLn('c. 800x600');
  366.     WriteLn('d. 1024x768');
  367.     WriteLn('e. 1280x1024');
  368.     WriteLn('Q uit');
  369.     WriteLn;
  370.     Write('Your choice: ');
  371.     REPEAT
  372.         ReadLn(choice2);
  373.     UNTIL choice2 IN ['a'..'e','q'];
  374.     IF choice2 = 'q' THEN Halt;
  375.  
  376.     CASE choice2 OF
  377.         'a' : BEGIN
  378.             xsize := 320;
  379.             ysize := 200;
  380.         END;
  381.         'b' : BEGIN
  382.             xsize := 640;
  383.             ysize := 480;
  384.         END;
  385.         'c' : BEGIN
  386.             xsize := 800;
  387.             ysize := 600;
  388.         END;
  389.         'd' : BEGIN
  390.             xsize := 1024;
  391.             ysize := 768;
  392.         END;
  393.         'e' : BEGIN
  394.             xsize := 1280;
  395.             ysize := 1024;
  396.         END;
  397.     END;
  398.     CASE choice1 OF
  399.         '1' : mode := FindVesaMode(xsize,ysize,8);
  400.         '2' : mode := FindVesaMode(xsize,ysize,15);
  401.         '3' : mode := FindVesaMode(xsize,ysize,16);
  402.         '4' : mode := FindVesaMode(xsize,ysize,24);
  403.     END;
  404.     IF mode = 0 THEN BEGIN
  405.         WriteLn('No such mode could be found !');
  406.         WriteLn('Switching to to 320x200.');
  407.         ReadKey;
  408.         mode := V320x200x256;
  409.     END;
  410. END;
  411.  
  412. begin { program body }
  413.   SelectMode;
  414.   Initialize;
  415.   ReportStatus;
  416.  
  417. {  AspectRatioPlay; }
  418.   FillEllipsePlay;
  419.   SectorPlay;
  420.   WriteModePlay;
  421.  
  422.   ColorPlay;
  423.   { PalettePlay only intended to work on these drivers: }
  424.   if (GraphDriver = EGA) or
  425.       (GraphDriver = EGA64) or
  426.       (GraphDriver = VGA) then
  427.      PalettePlay;
  428.   PutPixelPlay;
  429. {  PutImagePlay; }
  430.   RandBarPlay;
  431.   BarPlay;
  432.   Bar3DPlay;
  433.   ArcPlay;
  434.   CirclePlay;
  435.   PiePlay;
  436.   LineToPlay;
  437.   LineRelPlay;
  438. {  LineStylePlay; }
  439. {  UserLineStylePlay; }
  440.   TextDump;
  441.   TextPlay;
  442.   CrtModePlay;
  443.   FillStylePlay;
  444.   FillPatternPlay;
  445.   PolyPlay;
  446.   SayGoodbye;
  447. {  CloseGraph; }
  448.   CloseVesa;
  449. end.
  450. ***************************************************
  451.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  452.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  453. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  454. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  455. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  456. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  457.     Color := RandColor;
  458.     SetColor(Color);
  459.     SetFillStyle(Random(CloseDotFill)+1, Color);
  460.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  461.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  462.   until KeyPressed;
  463.   WaitToGo;
  464. end; { RandBarPlay }
  465.  
  466. procedure ArcPlay;
  467. { Draw random arcs on the screen }
  468. var
  469.   MaxRadius : word;
  470.   EndAngle : word;
  471.   ArcInfo : ArcCoordsType;
  472. begin
  473.   MainWindow('Arc / GetArcCoords demonstration');
  474.   StatusLine('Esc aborts or press a key');
  475.   MaxRadius := MaxY div 10;
  476.   repeat
  477.     SetColor(RandColor);
  478.     EndAngle := Random(360);
  479.     SetLineStyle(SolidLn, 0, NormWidth);
  480.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  481.     GetArcCoords(ArcInfo);
  482.     with ArcInfo do
  483.     begin
  484.       Line(X, Y, XStart, YStart);
  485.       Line(X, Y, Xend, Yend);
  486.     end;
  487.   until KeyPressed;
  488.   WaitToGo;
  489. end; { ArcPlay }
  490.  
  491. procedure PutPixelPlay;
  492. { Demonstrate the PutPixel and GetPixel commands }
  493. const
  494.   Seed   = 1962; { A seed for the random number generator }
  495.   NumPts = 2000; { The number of pixels plotted }
  496.   Esc    = #27;
  497. var
  498.   I : word;
  499.   X, Y, Color : word;
  500.   XMax, YMax  : integer;
  501.   ViewInfo    : ViewPortType;
  502. begin
  503.   MainWindow('PutPixel / GetPixel demonstration');
  504.   StatusLine('Esc aborts or press a key...');
  505.  
  506.   GetViewSettings(ViewInfo);
  507.   with ViewInfo do
  508.   begin
  509.     XMax := (x2-x1-1);
  510.     YMax := (y2-y1-1);
  511.   end;
  512.  
  513.   while not KeyPressed do
  514.   begin
  515.     { Plot random pixels }
  516.     RandSeed := Seed;
  517.     I := 0;
  518.     while (not KeyPressed) and (I < NumPts) do
  519.     begin
  520.       Inc(I);
  521.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  522.     end;
  523.  
  524.     { Erase pixels }
  525.     RandSeed := Seed;
  526.     I := 0;
  527.     while (not KeyPressed) and (I < NumPts) do
  528.     begin
  529.       Inc(I);
  530.       X := Random(XMax)+1;
  531.       Y := Random(YMax)+1;
  532.       Color := GetPixel(X, Y);
  533.         if Color = RandColor then
  534.           PutPixel(X, Y, 0);
  535.      end;
  536.   end;
  537.   WaitToGo;
  538. end; { PutPixelPlay }
  539.  
  540. procedure PutImagePlay;
  541. { Demonstrate the GetImage and PutImage commands }
  542.  
  543. const
  544.   r  = 20;
  545.   StartX = 100;
  546.   StartY = 50;
  547.  
  548. var
  549.   CurPort : ViewPortType;
  550.  
  551. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  552. var
  553.   Step : integer;
  554. begin
  555.   Step := Random(2*r);
  556.   if Odd(Step) then
  557.     Step := -Step;
  558.   X := X + Step;
  559.   Step := Random(r);
  560.   if Odd(Step) then
  561.     Step := -Step;
  562.   Y := Y + Step;
  563.  
  564.   { Make saucer bounce off viewport walls }
  565.   with CurPort do
  566.   begin
  567.     if (x1 + X + Width - 1 > x2) then
  568.       X := x2-x1 - Width + 1
  569.     else
  570.       if (X < 0) then
  571.         X := 0;
  572.     if (y1 + Y + Height - 1 > y2) then
  573.       Y := y2-y1 - Height + 1
  574.     else
  575.       if (Y < 0) then
  576.         Y := 0;
  577.   end;
  578. end; { MoveSaucer }
  579.  
  580. var
  581.   Pausetime : word;
  582.   Saucer    : pointer;
  583.   X, Y      : integer;
  584.   ulx, uly  : word;
  585.   lrx, lry  : word;
  586.   Size      : word;
  587.   I         : word;
  588. begin
  589.   ClearDevice;
  590.   FullPort;
  591.  
  592.   { PaintScreen }
  593.   ClearDevice;
  594.   MainWindow('GetImage / PutImage Demonstration');
  595.   StatusLine('Esc aborts or press a key...');
  596.   GetViewSettings(CurPort);
  597.  
  598.   { DrawSaucer }
  599.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  600.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  601.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  602.   Circle(StartX+10, StartY-12, 2);
  603.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  604.   Circle(StartX-10, StartY-12, 2);
  605.   SetFillStyle(SolidFill, MaxColor);
  606.   FloodFill(StartX+1, StartY+4, GetColor);
  607.  
  608.   { ReadSaucerImage }
  609.   ulx := StartX-(r+1);
  610.   uly := StartY-14;
  611.   lrx := StartX+(r+1);
  612.   lry := StartY+(r div 3)+3;
  613.  
  614.   Size := ImageSize(ulx, uly, lrx, lry);
  615.   GetMem(Saucer, Size);
  616.   GetImage(ulx, uly, lrx, lry, Saucer^);
  617. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  618.  
  619.   { Plot some "stars" }
  620.   for I := 1 to 1000 do
  621.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  622.   X := MaxX div 2;
  623.   Y := MaxY div 2;
  624.   PauseTime := 70;
  625.  
  626.   { Move the saucer around }
  627.   repeat
  628. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  629.      Delay(PauseTime);
  630. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  631.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  632.   until KeyPressed;
  633.   FreeMem(Saucer, size);
  634.   WaitToGo;
  635. end; { PutImagePlay }
  636.  
  637. procedure PolyPlay;
  638. { Draw random polygons with random fill styles on the screen }
  639. const
  640.   MaxPts = 5;
  641. type
  642.   PolygonType = array[1..MaxPts] of PointType;
  643. var
  644.   Poly : PolygonType;
  645.   I, Color : word;
  646. begin
  647.   MainWindow('FillPoly demonstration');
  648.   StatusLine('Esc aborts or press a key...');
  649.   repeat
  650.     Color := RandColor;
  651.     SetFillStyle(Random(11)+1, Color);
  652.     SetColor(Color);
  653.     for I := 1 to MaxPts do
  654.       with Poly[I] do
  655.       begin
  656.         X := Random(MaxX);
  657.         Y := Random(MaxY);
  658.       end;
  659.     FillPoly(MaxPts, Poly);
  660.   until KeyPressed;
  661.   WaitToGo;
  662. end; { PolyPlay }
  663.  
  664. procedure FillStylePlay;
  665. { Display all of the predefined fill styles available }
  666. var
  667.   Style    : word;
  668.   Width    : word;
  669.   Height   : word;
  670.   X, Y     : word;
  671.   I, J     : word;
  672.   ViewInfo : ViewPortType;
  673.  
  674. procedure DrawBox(X, Y : word);
  675. begin
  676.   SetFillStyle(Style, MaxColor);
  677.   with ViewInfo do
  678.     Bar(X, Y, X+Width, Y+Height);
  679.   Rectangle(X, Y, X+Width, Y+Height);
  680.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  681.   Inc(Style);
  682. end; { DrawBox }
  683.  
  684. begin
  685.   MainWindow('Pre-defined fill styles');
  686.   GetViewSettings(ViewInfo);
  687.   with ViewInfo do
  688.   begin
  689.     Width := 2 * ((x2+1) div 13);
  690.     Height := 2 * ((y2-10) div 10);
  691.   end;
  692.   X := Width div 2;
  693.   Y := Height div 2;
  694.   Style := 0;
  695.   for J := 1 to 3 do
  696.   begin
  697.     for I := 1 to 4 do
  698.     begin
  699.       DrawBox(X, Y);
  700.       Inc(X, (Width div 2) * 3);
  701.     end;
  702.     X := Width div 2;
  703.     Inc(Y, (Height div 2) * 3);
  704.   end;
  705.   SetTextJustify(LeftText, TopText);
  706.   WaitToGo;
  707. end; { FillStylePlay }
  708.  
  709. procedure FillPatternPlay;
  710. { Display some user defined fill patterns }
  711. const
  712.   Patterns : array[0..11] of FillPatternType = (
  713.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  714.             OldColor which has a path of pixels of OldColor or NewColor
  715.             with sides touching back to the seed point, (XSeed, YSeed).
  716.             Therefore, only pixels of OldColor are modified and no other
  717.             information is changed.
  718.  
  719.             SEE ALSO
  720.  
  721.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  722.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  723.             SETVIEW
  724.  
  725.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  726.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  727.             IF WHICHVGA = 0 THEN STOP
  728.             DUMMY=RES640
  729.             SETVIEW 100, 100, 539, 379
  730.             FILLVIEW 10
  731.             WHILE INKEY$ = ""
  732.             WEND
  733.             VIDEOMODESET VMODE
  734.             END
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.                                                                          63
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.           FONTGETINFO
  759.  
  760.             PROTOTYPE
  761.  
  762.             SUB FONTGETINFO (Width%, Height%)
  763.  
  764.             INPUT
  765.  
  766.             no input parameters
  767.     WEND
  768.             MOUSEEXIT
  769.             VIDEOMODESET VMODE
  770.             END
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.                                                                          86
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.           MOUSECURSORDEFAULT
  819.  
  820.             PROTOTYPE
  821.  
  822.             SUB MOUSECURSORDEFAULT ()
  823.  
  824.             INPUT
  825.  
  826.             no input parameters
  827.  
  828.             OUTPUT
  829.  
  830.             no value returned
  831.  
  832.             USAGE
  833.  
  834.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  835.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  836. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  837. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  838. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  839. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  840. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  841. $╤
  842. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  843. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  844. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  845. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  846. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  847. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  848. ░£▒
  849. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  850. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  851.       end;
  852.     end;
  853.   end;
  854.   WaitToGo;
  855. end; { UserLineStylePlay }
  856.  
  857.  
  858. procedure SayGoodbye;
  859. { Say goodbye and then exit the program }
  860. var
  861.   ViewInfo : ViewPortType;
  862. begin
  863.   MainWindow('');
  864.   GetViewSettings(ViewInfo);
  865.   SetTextStyle(TriplexFont, HorizDir, 4);
  866.   SetTextJustify(CenterText, CenterText);
  867.   with ViewInfo do
  868.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  869.   StatusLine('Press any key to quit...');
  870.   repeat until KeyPressed;
  871. end; { SayGoodbye }
  872.  
  873.  
  874. PROCEDURE SelectMode;
  875. VAR
  876.     choice1,choice2     : CHAR;
  877.    xsize,ysize            : WORD;
  878. BEGIN
  879.     (* Let's select a mode *)
  880.     ClrScr;
  881.     WriteLn('VESADEMO:');
  882.     WriteLn('1. 256 colors');
  883.     WriteLn('2. 32768 colors');
  884.     WriteLn('3. 65536 colors');
  885.     WriteLn('4. 16777216 colors');
  886.     WriteLn('Q uit');
  887.     WriteLn;
  888.     Write('Your choice: ');
  889.     REPEAT
  890.         ReadLn(choice1);
  891.       IF choice1 <> '1' THEN BEGIN
  892.           WriteLn('Sorry !');
  893.          WriteLn('This demo wasn''t written for more as 256 colors !');
  894.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  895.          WriteLn('Switching to 256 colors.');
  896.          choice1 := '1';
  897.       END;
  898.     UNTIL choice1 IN ['1'..'4','q'];
  899.     IF choice1 = 'q' THEN Halt;
  900.  
  901.     WriteLn;
  902.     WriteLn;
  903.     WriteLn('a. 320x200');
  904.     WriteLn('b. 640x480');
  905.     WriteLn('c. 800x600');
  906.     WriteLn('d. 1024x768');
  907.     WriteLn('e. 1280x1024');
  908.     WriteLn('Q uit');
  909.     WriteLn;
  910.     Write('Your choice: ');
  911.     REPEAT
  912.         ReadLn(choice2);
  913.     UNTIL choice2 IN ['a'..'e','q'];
  914.     IF choice2 = 'q' THEN Halt;
  915.  
  916.     CASE choice2 OF
  917.         'a' : BEGIN
  918.             xsize := 320;
  919.             ysize := 200;
  920.         END;
  921.         'b' : BEGIN
  922.             xsize := 640;
  923.             ysize := 480;
  924.         END;
  925.         'c' : BEGIN
  926.             xsize := 800;
  927.             ysize := 600;
  928.         END;
  929.         'd' : BEGIN
  930.             xsize := 1024;
  931.             ysize := 768;
  932.         END;
  933.         'e' : BEGIN
  934.             xsize := 1280;
  935.             ysize := 1024;
  936.         END;
  937.     END;
  938.     CASE choice1 OF
  939.         '1' : mode := FindVesaMode(xsize,ysize,8);
  940.         '2' : mode := FindVesaMode(xsize,ysize,15);
  941.         '3' : mode := FindVesaMode(xsize,ysize,16);
  942.         '4' : mode := FindVesaMode(xsize,ysize,24);
  943.     END;
  944.     IF mode = 0 THEN BEGIN
  945.         WriteLn('No such mode could be found !');
  946.         WriteLn('Switching to to 320x200.');
  947.         ReadKey;
  948.         mode := V320x200x256;
  949.     END;
  950. END;
  951.  
  952. begin { program body }
  953.   SelectMode;
  954.   Initialize;
  955.   ReportStatus;
  956.  
  957. {  AspectRatioPlay; }
  958.   FillEllipsePlay;
  959.   SectorPlay;
  960.   WriteModePlay;
  961.  
  962.   ColorPlay;
  963.   { PalettePlay only intended to work on these drivers: }
  964.   if (GraphDriver = EGA) or
  965.       (GraphDriver = EGA64) or
  966.       (GraphDriver = VGA) then
  967.      PalettePlay;
  968.   PutPixelPlay;
  969. {  PutImagePlay; }
  970.   RandBarPlay;
  971.   BarPlay;
  972.   Bar3DPlay;
  973.   ArcPlay;
  974.   CirclePlay;
  975.   PiePlay;
  976.   LineToPlay;
  977.   LineRelPlay;
  978. {  LineStylePlay; }
  979. {  UserLineStylePlay; }
  980.   TextDump;
  981.   TextPlay;
  982.   CrtModePlay;
  983.   FillStylePlay;
  984.   FillPatternPlay;
  985.   PolyPlay;
  986.   SayGoodbye;
  987. {  CloseGraph; }
  988.   CloseVesa;
  989. end.
  990. ***************************************************
  991.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  992.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  993. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  994. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  995. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  996. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  997.     Color := RandColor;
  998.     SetColor(Color);
  999.     SetFillStyle(Random(CloseDotFill)+1, Color);
  1000.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  1001.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  1002.   until KeyPressed;
  1003.   WaitToGo;
  1004. end; { RandBarPlay }
  1005.  
  1006. procedure ArcPlay;
  1007. { Draw random arcs on the screen }
  1008. var
  1009.   MaxRadius : word;
  1010.   EndAngle : word;
  1011.   ArcInfo : ArcCoordsType;
  1012. begin
  1013.   MainWindow('Arc / GetArcCoords demonstration');
  1014.   StatusLine('Esc aborts or press a key');
  1015.   MaxRadius := MaxY div 10;
  1016.   repeat
  1017.     SetColor(RandColor);
  1018.     EndAngle := Random(360);
  1019.     SetLineStyle(SolidLn, 0, NormWidth);
  1020.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  1021.     GetArcCoords(ArcInfo);
  1022.     with ArcInfo do
  1023.     begin
  1024.       Line(X, Y, XStart, YStart);
  1025.       Line(X, Y, Xend, Yend);
  1026.     end;
  1027.   until KeyPressed;
  1028.   WaitToGo;
  1029. end; { ArcPlay }
  1030.  
  1031. procedure PutPixelPlay;
  1032. { Demonstrate the PutPixel and GetPixel commands }
  1033. const
  1034.   Seed   = 1962; { A seed for the random number generator }
  1035.   NumPts = 2000; { The number of pixels plotted }
  1036.   Esc    = #27;
  1037. var
  1038.   I : word;
  1039.   X, Y, Color : word;
  1040.   XMax, YMax  : integer;
  1041.   ViewInfo    : ViewPortType;
  1042. begin
  1043.   MainWindow('PutPixel / GetPixel demonstration');
  1044.   StatusLine('Esc aborts or press a key...');
  1045.  
  1046.   GetViewSettings(ViewInfo);
  1047.   with ViewInfo do
  1048.   begin
  1049.     XMax := (x2-x1-1);
  1050.     YMax := (y2-y1-1);
  1051.   end;
  1052.  
  1053.   while not KeyPressed do
  1054.   begin
  1055.     { Plot random pixels }
  1056.     RandSeed := Seed;
  1057.     I := 0;
  1058.     while (not KeyPressed) and (I < NumPts) do
  1059.     begin
  1060.       Inc(I);
  1061.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  1062.     end;
  1063.  
  1064.     { Erase pixels }
  1065.     RandSeed := Seed;
  1066.     I := 0;
  1067.     while (not KeyPressed) and (I < NumPts) do
  1068.     begin
  1069.       Inc(I);
  1070.       X := Random(XMax)+1;
  1071.       Y := Random(YMax)+1;
  1072.       Color := GetPixel(X, Y);
  1073.         if Color = RandColor then
  1074.           PutPixel(X, Y, 0);
  1075.      end;
  1076.   end;
  1077.   WaitToGo;
  1078. end; { PutPixelPlay }
  1079.  
  1080. procedure PutImagePlay;
  1081. { Demonstrate the GetImage and PutImage commands }
  1082.  
  1083. const
  1084.   r  = 20;
  1085.   StartX = 100;
  1086.   StartY = 50;
  1087.  
  1088. var
  1089.   CurPort : ViewPortType;
  1090.  
  1091. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  1092. var
  1093.   Step : integer;
  1094. begin
  1095.   Step := Random(2*r);
  1096.   if Odd(Step) then
  1097.     Step := -Step;
  1098.   X := X + Step;
  1099.   Step := Random(r);
  1100.   if Odd(Step) then
  1101.     Step := -Step;
  1102.   Y := Y + Step;
  1103.  
  1104.   { Make saucer bounce off viewport walls }
  1105.   with CurPort do
  1106.   begin
  1107.     if (x1 + X + Width - 1 > x2) then
  1108.       X := x2-x1 - Width + 1
  1109.     else
  1110.       if (X < 0) then
  1111.         X := 0;
  1112.     if (y1 + Y + Height - 1 > y2) then
  1113.       Y := y2-y1 - Height + 1
  1114.     else
  1115.       if (Y < 0) then
  1116.         Y := 0;
  1117.   end;
  1118. end; { MoveSaucer }
  1119.  
  1120. var
  1121.   Pausetime : word;
  1122.   Saucer    : pointer;
  1123.   X, Y      : integer;
  1124.   ulx, uly  : word;
  1125.   lrx, lry  : word;
  1126.   Size      : word;
  1127.   I         : word;
  1128. begin
  1129.   ClearDevice;
  1130.   FullPort;
  1131.  
  1132.   { PaintScreen }
  1133.   ClearDevice;
  1134.   MainWindow('GetImage / PutImage Demonstration');
  1135.   StatusLine('Esc aborts or press a key...');
  1136.   GetViewSettings(CurPort);
  1137.  
  1138.   { DrawSaucer }
  1139.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  1140.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  1141.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  1142.   Circle(StartX+10, StartY-12, 2);
  1143.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  1144.   Circle(StartX-10, StartY-12, 2);
  1145.   SetFillStyle(SolidFill, MaxColor);
  1146.   FloodFill(StartX+1, StartY+4, GetColor);
  1147.  
  1148.   { ReadSaucerImage }
  1149.   ulx := StartX-(r+1);
  1150.   uly := StartY-14;
  1151.   lrx := StartX+(r+1);
  1152.   lry := StartY+(r div 3)+3;
  1153.  
  1154.   Size := ImageSize(ulx, uly, lrx, lry);
  1155.   GetMem(Saucer, Size);
  1156.   GetImage(ulx, uly, lrx, lry, Saucer^);
  1157. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  1158.  
  1159.   { Plot some "stars" }
  1160.   for I := 1 to 1000 do
  1161.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  1162.   X := MaxX div 2;
  1163.   Y := MaxY div 2;
  1164.   PauseTime := 70;
  1165.  
  1166.   { Move the saucer around }
  1167.   repeat
  1168. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  1169.      Delay(PauseTime);
  1170. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  1171.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  1172.   until KeyPressed;
  1173.   FreeMem(Saucer, size);
  1174.   WaitToGo;
  1175. end; { PutImagePlay }
  1176.  
  1177. procedure PolyPlay;
  1178. { Draw random polygons with random fill styles on the screen }
  1179. const
  1180.   MaxPts = 5;
  1181. type
  1182.   PolygonType = array[1..MaxPts] of PointType;
  1183. var
  1184.   Poly : PolygonType;
  1185.   I, Color : word;
  1186. begin
  1187.   MainWindow('FillPoly demonstration');
  1188.   StatusLine('Esc aborts or press a key...');
  1189.   repeat
  1190.     Color := RandColor;
  1191.     SetFillStyle(Random(11)+1, Color);
  1192.     SetColor(Color);
  1193.     for I := 1 to MaxPts do
  1194.       with Poly[I] do
  1195.       begin
  1196.         X := Random(MaxX);
  1197.         Y := Random(MaxY);
  1198.       end;
  1199.     FillPoly(MaxPts, Poly);
  1200.   until KeyPressed;
  1201.   WaitToGo;
  1202. end; { PolyPlay }
  1203.  
  1204. procedure FillStylePlay;
  1205. { Display all of the predefined fill styles available }
  1206. var
  1207.   Style    : word;
  1208.   Width    : word;
  1209.   Height   : word;
  1210.   X, Y     : word;
  1211.   I, J     : word;
  1212.   ViewInfo : ViewPortType;
  1213.  
  1214. procedure DrawBox(X, Y : word);
  1215. begin
  1216.   SetFillStyle(Style, MaxColor);
  1217.   with ViewInfo do
  1218.     Bar(X, Y, X+Width, Y+Height);
  1219.   Rectangle(X, Y, X+Width, Y+Height);
  1220.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  1221.   Inc(Style);
  1222. end; { DrawBox }
  1223.  
  1224. begin
  1225.   MainWindow('Pre-defined fill styles');
  1226.   GetViewSettings(ViewInfo);
  1227.   with ViewInfo do
  1228.   begin
  1229.     Width := 2 * ((x2+1) div 13);
  1230.     Height := 2 * ((y2-10) div 10);
  1231.   end;
  1232.   X := Width div 2;
  1233.   Y := Height div 2;
  1234.   Style := 0;
  1235.   for J := 1 to 3 do
  1236.   begin
  1237.     for I := 1 to 4 do
  1238.     begin
  1239.       DrawBox(X, Y);
  1240.       Inc(X, (Width div 2) * 3);
  1241.     end;
  1242.     X := Width div 2;
  1243.     Inc(Y, (Height div 2) * 3);
  1244.   end;
  1245.   SetTextJustify(LeftText, TopText);
  1246.   WaitToGo;
  1247. end; { FillStylePlay }
  1248.  
  1249. procedure FillPatternPlay;
  1250. { Display some user defined fill patterns }
  1251. const
  1252.   Patterns : array[0..11] of FillPatternType = (
  1253.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  1254.             OldColor which has a path of pixels of OldColor or NewColor
  1255.             with sides touching back to the seed point, (XSeed, YSeed).
  1256.             Therefore, only pixels of OldColor are modified and no other
  1257.             information is changed.
  1258.  
  1259.             SEE ALSO
  1260.  
  1261.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  1262.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  1263.             SETVIEW
  1264.  
  1265.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  1266.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  1267.             IF WHICHVGA = 0 THEN STOP
  1268.             DUMMY=RES640
  1269.             SETVIEW 100, 100, 539, 379
  1270.             FILLVIEW 10
  1271.             WHILE INKEY$ = ""
  1272.             WEND
  1273.             VIDEOMODESET VMODE
  1274.             END
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.                                                                          63
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.           FONTGETINFO
  1299.  
  1300.             PROTOTYPE
  1301.  
  1302.             SUB FONTGETINFO (Width%, Height%)
  1303.  
  1304.             INPUT
  1305.  
  1306.             no input parameters
  1307.     WEND
  1308.             MOUSEEXIT
  1309.             VIDEOMODESET VMODE
  1310.             END
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.                                                                          86
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.           MOUSECURSORDEFAULT
  1359.  
  1360.             PROTOTYPE
  1361.  
  1362.             SUB MOUSECURSORDEFAULT ()
  1363.  
  1364.             INPUT
  1365.  
  1366.             no input parameters
  1367.  
  1368.             OUTPUT
  1369.  
  1370.             no value returned
  1371.  
  1372.             USAGE
  1373.  
  1374.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  1375.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  1376. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  1377. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  1378. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  1379. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  1380. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  1381. $╤
  1382. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  1383. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  1384. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  1385. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  1386. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  1387. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  1388. ░£▒
  1389. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  1390. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  1391.       end;
  1392.     end;
  1393.   end;
  1394.   WaitToGo;
  1395. end; { UserLineStylePlay }
  1396.  
  1397.  
  1398. procedure SayGoodbye;
  1399. { Say goodbye and then exit the program }
  1400. var
  1401.   ViewInfo : ViewPortType;
  1402. begin
  1403.   MainWindow('');
  1404.   GetViewSettings(ViewInfo);
  1405.   SetTextStyle(TriplexFont, HorizDir, 4);
  1406.   SetTextJustify(CenterText, CenterText);
  1407.   with ViewInfo do
  1408.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  1409.   StatusLine('Press any key to quit...');
  1410.   repeat until KeyPressed;
  1411. end; { SayGoodbye }
  1412.  
  1413.  
  1414. PROCEDURE SelectMode;
  1415. VAR
  1416.     choice1,choice2     : CHAR;
  1417.    xsize,ysize            : WORD;
  1418. BEGIN
  1419.     (* Let's select a mode *)
  1420.     ClrScr;
  1421.     WriteLn('VESADEMO:');
  1422.     WriteLn('1. 256 colors');
  1423.     WriteLn('2. 32768 colors');
  1424.     WriteLn('3. 65536 colors');
  1425.     WriteLn('4. 16777216 colors');
  1426.     WriteLn('Q uit');
  1427.     WriteLn;
  1428.     Write('Your choice: ');
  1429.     REPEAT
  1430.         ReadLn(choice1);
  1431.       IF choice1 <> '1' THEN BEGIN
  1432.           WriteLn('Sorry !');
  1433.          WriteLn('This demo wasn''t written for more as 256 colors !');
  1434.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  1435.          WriteLn('Switching to 256 colors.');
  1436.          choice1 := '1';
  1437.       END;
  1438.     UNTIL choice1 IN ['1'..'4','q'];
  1439.     IF choice1 = 'q' THEN Halt;
  1440.  
  1441.     WriteLn;
  1442.     WriteLn;
  1443.     WriteLn('a. 320x200');
  1444.     WriteLn('b. 640x480');
  1445.     WriteLn('c. 800x600');
  1446.     WriteLn('d. 1024x768');
  1447.     WriteLn('e. 1280x1024');
  1448.     WriteLn('Q uit');
  1449.     WriteLn;
  1450.     Write('Your choice: ');
  1451.     REPEAT
  1452.         ReadLn(choice2);
  1453.     UNTIL choice2 IN ['a'..'e','q'];
  1454.     IF choice2 = 'q' THEN Halt;
  1455.  
  1456.     CASE choice2 OF
  1457.         'a' : BEGIN
  1458.             xsize := 320;
  1459.             ysize := 200;
  1460.         END;
  1461.         'b' : BEGIN
  1462.             xsize := 640;
  1463.             ysize := 480;
  1464.         END;
  1465.         'c' : BEGIN
  1466.             xsize := 800;
  1467.             ysize := 600;
  1468.         END;
  1469.         'd' : BEGIN
  1470.             xsize := 1024;
  1471.             ysize := 768;
  1472.         END;
  1473.         'e' : BEGIN
  1474.             xsize := 1280;
  1475.             ysize := 1024;
  1476.         END;
  1477.     END;
  1478.     CASE choice1 OF
  1479.         '1' : mode := FindVesaMode(xsize,ysize,8);
  1480.         '2' : mode := FindVesaMode(xsize,ysize,15);
  1481.         '3' : mode := FindVesaMode(xsize,ysize,16);
  1482.         '4' : mode := FindVesaMode(xsize,ysize,24);
  1483.     END;
  1484.     IF mode = 0 THEN BEGIN
  1485.         WriteLn('No such mode could be found !');
  1486.         WriteLn('Switching to to 320x200.');
  1487.         ReadKey;
  1488.         mode := V320x200x256;
  1489.     END;
  1490. END;
  1491.  
  1492. begin { program body }
  1493.   SelectMode;
  1494.   Initialize;
  1495.   ReportStatus;
  1496.  
  1497. {  AspectRatioPlay; }
  1498.   FillEllipsePlay;
  1499.   SectorPlay;
  1500.   WriteModePlay;
  1501.  
  1502.   ColorPlay;
  1503.   { PalettePlay only intended to work on these drivers: }
  1504.   if (GraphDriver = EGA) or
  1505.       (GraphDriver = EGA64) or
  1506.       (GraphDriver = VGA) then
  1507.      PalettePlay;
  1508.   PutPixelPlay;
  1509. {  PutImagePlay; }
  1510.   RandBarPlay;
  1511.   BarPlay;
  1512.   Bar3DPlay;
  1513.   ArcPlay;
  1514.   CirclePlay;
  1515.   PiePlay;
  1516.   LineToPlay;
  1517.   LineRelPlay;
  1518. {  LineStylePlay; }
  1519. {  UserLineStylePlay; }
  1520.   TextDump;
  1521.   TextPlay;
  1522.   CrtModePlay;
  1523.   FillStylePlay;
  1524.   FillPatternPlay;
  1525.   PolyPlay;
  1526.   SayGoodbye;
  1527. {  CloseGraph; }
  1528.   CloseVesa;
  1529. end.
  1530. ***************************************************
  1531.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  1532.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  1533. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  1534. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  1535. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  1536. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  1537.     Color := RandColor;
  1538.     SetColor(Color);
  1539.     SetFillStyle(Random(CloseDotFill)+1, Color);
  1540.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  1541.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  1542.   until KeyPressed;
  1543.   WaitToGo;
  1544. end; { RandBarPlay }
  1545.  
  1546. procedure ArcPlay;
  1547. { Draw random arcs on the screen }
  1548. var
  1549.   MaxRadius : word;
  1550.   EndAngle : word;
  1551.   ArcInfo : ArcCoordsType;
  1552. begin
  1553.   MainWindow('Arc / GetArcCoords demonstration');
  1554.   StatusLine('Esc aborts or press a key');
  1555.   MaxRadius := MaxY div 10;
  1556.   repeat
  1557.     SetColor(RandColor);
  1558.     EndAngle := Random(360);
  1559.     SetLineStyle(SolidLn, 0, NormWidth);
  1560.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  1561.     GetArcCoords(ArcInfo);
  1562.     with ArcInfo do
  1563.     begin
  1564.       Line(X, Y, XStart, YStart);
  1565.       Line(X, Y, Xend, Yend);
  1566.     end;
  1567.   until KeyPressed;
  1568.   WaitToGo;
  1569. end; { ArcPlay }
  1570.  
  1571. procedure PutPixelPlay;
  1572. { Demonstrate the PutPixel and GetPixel commands }
  1573. const
  1574.   Seed   = 1962; { A seed for the random number generator }
  1575.   NumPts = 2000; { The number of pixels plotted }
  1576.   Esc    = #27;
  1577. var
  1578.   I : word;
  1579.   X, Y, Color : word;
  1580.   XMax, YMax  : integer;
  1581.   ViewInfo    : ViewPortType;
  1582. begin
  1583.   MainWindow('PutPixel / GetPixel demonstration');
  1584.   StatusLine('Esc aborts or press a key...');
  1585.  
  1586.   GetViewSettings(ViewInfo);
  1587.   with ViewInfo do
  1588.   begin
  1589.     XMax := (x2-x1-1);
  1590.     YMax := (y2-y1-1);
  1591.   end;
  1592.  
  1593.   while not KeyPressed do
  1594.   begin
  1595.     { Plot random pixels }
  1596.     RandSeed := Seed;
  1597.     I := 0;
  1598.     while (not KeyPressed) and (I < NumPts) do
  1599.     begin
  1600.       Inc(I);
  1601.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  1602.     end;
  1603.  
  1604.     { Erase pixels }
  1605.     RandSeed := Seed;
  1606.     I := 0;
  1607.     while (not KeyPressed) and (I < NumPts) do
  1608.     begin
  1609.       Inc(I);
  1610.       X := Random(XMax)+1;
  1611.       Y := Random(YMax)+1;
  1612.       Color := GetPixel(X, Y);
  1613.         if Color = RandColor then
  1614.           PutPixel(X, Y, 0);
  1615.      end;
  1616.   end;
  1617.   WaitToGo;
  1618. end; { PutPixelPlay }
  1619.  
  1620. procedure PutImagePlay;
  1621. { Demonstrate the GetImage and PutImage commands }
  1622.  
  1623. const
  1624.   r  = 20;
  1625.   StartX = 100;
  1626.   StartY = 50;
  1627.  
  1628. var
  1629.   CurPort : ViewPortType;
  1630.  
  1631. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  1632. var
  1633.   Step : integer;
  1634. begin
  1635.   Step := Random(2*r);
  1636.   if Odd(Step) then
  1637.     Step := -Step;
  1638.   X := X + Step;
  1639.   Step := Random(r);
  1640.   if Odd(Step) then
  1641.     Step := -Step;
  1642.   Y := Y + Step;
  1643.  
  1644.   { Make saucer bounce off viewport walls }
  1645.   with CurPort do
  1646.   begin
  1647.     if (x1 + X + Width - 1 > x2) then
  1648.       X := x2-x1 - Width + 1
  1649.     else
  1650.       if (X < 0) then
  1651.         X := 0;
  1652.     if (y1 + Y + Height - 1 > y2) then
  1653.       Y := y2-y1 - Height + 1
  1654.     else
  1655.       if (Y < 0) then
  1656.         Y := 0;
  1657.   end;
  1658. end; { MoveSaucer }
  1659.  
  1660. var
  1661.   Pausetime : word;
  1662.   Saucer    : pointer;
  1663.   X, Y      : integer;
  1664.   ulx, uly  : word;
  1665.   lrx, lry  : word;
  1666.   Size      : word;
  1667.   I         : word;
  1668. begin
  1669.   ClearDevice;
  1670.   FullPort;
  1671.  
  1672.   { PaintScreen }
  1673.   ClearDevice;
  1674.   MainWindow('GetImage / PutImage Demonstration');
  1675.   StatusLine('Esc aborts or press a key...');
  1676.   GetViewSettings(CurPort);
  1677.  
  1678.   { DrawSaucer }
  1679.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  1680.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  1681.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  1682.   Circle(StartX+10, StartY-12, 2);
  1683.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  1684.   Circle(StartX-10, StartY-12, 2);
  1685.   SetFillStyle(SolidFill, MaxColor);
  1686.   FloodFill(StartX+1, StartY+4, GetColor);
  1687.  
  1688.   { ReadSaucerImage }
  1689.   ulx := StartX-(r+1);
  1690.   uly := StartY-14;
  1691.   lrx := StartX+(r+1);
  1692.   lry := StartY+(r div 3)+3;
  1693.  
  1694.   Size := ImageSize(ulx, uly, lrx, lry);
  1695.   GetMem(Saucer, Size);
  1696.   GetImage(ulx, uly, lrx, lry, Saucer^);
  1697. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  1698.  
  1699.   { Plot some "stars" }
  1700.   for I := 1 to 1000 do
  1701.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  1702.   X := MaxX div 2;
  1703.   Y := MaxY div 2;
  1704.   PauseTime := 70;
  1705.  
  1706.   { Move the saucer around }
  1707.   repeat
  1708. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  1709.      Delay(PauseTime);
  1710. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  1711.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  1712.   until KeyPressed;
  1713.   FreeMem(Saucer, size);
  1714.   WaitToGo;
  1715. end; { PutImagePlay }
  1716.  
  1717. procedure PolyPlay;
  1718. { Draw random polygons with random fill styles on the screen }
  1719. const
  1720.   MaxPts = 5;
  1721. type
  1722.   PolygonType = array[1..MaxPts] of PointType;
  1723. var
  1724.   Poly : PolygonType;
  1725.   I, Color : word;
  1726. begin
  1727.   MainWindow('FillPoly demonstration');
  1728.   StatusLine('Esc aborts or press a key...');
  1729.   repeat
  1730.     Color := RandColor;
  1731.     SetFillStyle(Random(11)+1, Color);
  1732.     SetColor(Color);
  1733.     for I := 1 to MaxPts do
  1734.       with Poly[I] do
  1735.       begin
  1736.         X := Random(MaxX);
  1737.         Y := Random(MaxY);
  1738.       end;
  1739.     FillPoly(MaxPts, Poly);
  1740.   until KeyPressed;
  1741.   WaitToGo;
  1742. end; { PolyPlay }
  1743.  
  1744. procedure FillStylePlay;
  1745. { Display all of the predefined fill styles available }
  1746. var
  1747.   Style    : word;
  1748.   Width    : word;
  1749.   Height   : word;
  1750.   X, Y     : word;
  1751.   I, J     : word;
  1752.   ViewInfo : ViewPortType;
  1753.  
  1754. procedure DrawBox(X, Y : word);
  1755. begin
  1756.   SetFillStyle(Style, MaxColor);
  1757.   with ViewInfo do
  1758.     Bar(X, Y, X+Width, Y+Height);
  1759.   Rectangle(X, Y, X+Width, Y+Height);
  1760.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  1761.   Inc(Style);
  1762. end; { DrawBox }
  1763.  
  1764. begin
  1765.   MainWindow('Pre-defined fill styles');
  1766.   GetViewSettings(ViewInfo);
  1767.   with ViewInfo do
  1768.   begin
  1769.     Width := 2 * ((x2+1) div 13);
  1770.     Height := 2 * ((y2-10) div 10);
  1771.   end;
  1772.   X := Width div 2;
  1773.   Y := Height div 2;
  1774.   Style := 0;
  1775.   for J := 1 to 3 do
  1776.   begin
  1777.     for I := 1 to 4 do
  1778.     begin
  1779.       DrawBox(X, Y);
  1780.       Inc(X, (Width div 2) * 3);
  1781.     end;
  1782.     X := Width div 2;
  1783.     Inc(Y, (Height div 2) * 3);
  1784.   end;
  1785.   SetTextJustify(LeftText, TopText);
  1786.   WaitToGo;
  1787. end; { FillStylePlay }
  1788.  
  1789. procedure FillPatternPlay;
  1790. { Display some user defined fill patterns }
  1791. const
  1792.   Patterns : array[0..11] of FillPatternType = (
  1793.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  1794.             OldColor which has a path of pixels of OldColor or NewColor
  1795.             with sides touching back to the seed point, (XSeed, YSeed).
  1796.             Therefore, only pixels of OldColor are modified and no other
  1797.             information is changed.
  1798.  
  1799.             SEE ALSO
  1800.  
  1801.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  1802.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  1803.             SETVIEW
  1804.  
  1805.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  1806.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  1807.             IF WHICHVGA = 0 THEN STOP
  1808.             DUMMY=RES640
  1809.             SETVIEW 100, 100, 539, 379
  1810.             FILLVIEW 10
  1811.             WHILE INKEY$ = ""
  1812.             WEND
  1813.             VIDEOMODESET VMODE
  1814.             END
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.                                                                          63
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.           FONTGETINFO
  1839.  
  1840.             PROTOTYPE
  1841.  
  1842.             SUB FONTGETINFO (Width%, Height%)
  1843.  
  1844.             INPUT
  1845.  
  1846.             no input parameters
  1847.     WEND
  1848.             MOUSEEXIT
  1849.             VIDEOMODESET VMODE
  1850.             END
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.                                                                          86
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.           MOUSECURSORDEFAULT
  1899.  
  1900.             PROTOTYPE
  1901.  
  1902.             SUB MOUSECURSORDEFAULT ()
  1903.  
  1904.             INPUT
  1905.  
  1906.             no input parameters
  1907.  
  1908.             OUTPUT
  1909.  
  1910.             no value returned
  1911.  
  1912.             USAGE
  1913.  
  1914.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  1915.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  1916. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  1917. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  1918. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  1919. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  1920. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  1921. $╤
  1922. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  1923. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  1924. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  1925. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  1926. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  1927. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  1928. ░£▒
  1929. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  1930. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  1931.       end;
  1932.     end;
  1933.   end;
  1934.   WaitToGo;
  1935. end; { UserLineStylePlay }
  1936.  
  1937.  
  1938. procedure SayGoodbye;
  1939. { Say goodbye and then exit the program }
  1940. var
  1941.   ViewInfo : ViewPortType;
  1942. begin
  1943.   MainWindow('');
  1944.   GetViewSettings(ViewInfo);
  1945.   SetTextStyle(TriplexFont, HorizDir, 4);
  1946.   SetTextJustify(CenterText, CenterText);
  1947.   with ViewInfo do
  1948.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  1949.   StatusLine('Press any key to quit...');
  1950.   repeat until KeyPressed;
  1951. end; { SayGoodbye }
  1952.  
  1953.  
  1954. PROCEDURE SelectMode;
  1955. VAR
  1956.     choice1,choice2     : CHAR;
  1957.    xsize,ysize            : WORD;
  1958. BEGIN
  1959.     (* Let's select a mode *)
  1960.     ClrScr;
  1961.     WriteLn('VESADEMO:');
  1962.     WriteLn('1. 256 colors');
  1963.     WriteLn('2. 32768 colors');
  1964.     WriteLn('3. 65536 colors');
  1965.     WriteLn('4. 16777216 colors');
  1966.     WriteLn('Q uit');
  1967.     WriteLn;
  1968.     Write('Your choice: ');
  1969.     REPEAT
  1970.         ReadLn(choice1);
  1971.       IF choice1 <> '1' THEN BEGIN
  1972.           WriteLn('Sorry !');
  1973.          WriteLn('This demo wasn''t written for more as 256 colors !');
  1974.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  1975.          WriteLn('Switching to 256 colors.');
  1976.          choice1 := '1';
  1977.       END;
  1978.     UNTIL choice1 IN ['1'..'4','q'];
  1979.     IF choice1 = 'q' THEN Halt;
  1980.  
  1981.     WriteLn;
  1982.     WriteLn;
  1983.     WriteLn('a. 320x200');
  1984.     WriteLn('b. 640x480');
  1985.     WriteLn('c. 800x600');
  1986.     WriteLn('d. 1024x768');
  1987.     WriteLn('e. 1280x1024');
  1988.     WriteLn('Q uit');
  1989.     WriteLn;
  1990.     Write('Your choice: ');
  1991.     REPEAT
  1992.         ReadLn(choice2);
  1993.     UNTIL choice2 IN ['a'..'e','q'];
  1994.     IF choice2 = 'q' THEN Halt;
  1995.  
  1996.     CASE choice2 OF
  1997.         'a' : BEGIN
  1998.             xsize := 320;
  1999.             ysize := 200;
  2000.         END;
  2001.         'b' : BEGIN
  2002.             xsize := 640;
  2003.             ysize := 480;
  2004.         END;
  2005.         'c' : BEGIN
  2006.             xsize := 800;
  2007.             ysize := 600;
  2008.         END;
  2009.         'd' : BEGIN
  2010.             xsize := 1024;
  2011.             ysize := 768;
  2012.         END;
  2013.         'e' : BEGIN
  2014.             xsize := 1280;
  2015.             ysize := 1024;
  2016.         END;
  2017.     END;
  2018.     CASE choice1 OF
  2019.         '1' : mode := FindVesaMode(xsize,ysize,8);
  2020.         '2' : mode := FindVesaMode(xsize,ysize,15);
  2021.         '3' : mode := FindVesaMode(xsize,ysize,16);
  2022.         '4' : mode := FindVesaMode(xsize,ysize,24);
  2023.     END;
  2024.     IF mode = 0 THEN BEGIN
  2025.         WriteLn('No such mode could be found !');
  2026.         WriteLn('Switching to to 320x200.');
  2027.         ReadKey;
  2028.         mode := V320x200x256;
  2029.     END;
  2030. END;
  2031.  
  2032. begin { program body }
  2033.   SelectMode;
  2034.   Initialize;
  2035.   ReportStatus;
  2036.  
  2037. {  AspectRatioPlay; }
  2038.   FillEllipsePlay;
  2039.   SectorPlay;
  2040.   WriteModePlay;
  2041.  
  2042.   ColorPlay;
  2043.   { PalettePlay only intended to work on these drivers: }
  2044.   if (GraphDriver = EGA) or
  2045.       (GraphDriver = EGA64) or
  2046.       (GraphDriver = VGA) then
  2047.      PalettePlay;
  2048.   PutPixelPlay;
  2049. {  PutImagePlay; }
  2050.   RandBarPlay;
  2051.   BarPlay;
  2052.   Bar3DPlay;
  2053.   ArcPlay;
  2054.   CirclePlay;
  2055.   PiePlay;
  2056.   LineToPlay;
  2057.   LineRelPlay;
  2058. {  LineStylePlay; }
  2059. {  UserLineStylePlay; }
  2060.   TextDump;
  2061.   TextPlay;
  2062.   CrtModePlay;
  2063.   FillStylePlay;
  2064.   FillPatternPlay;
  2065.   PolyPlay;
  2066.   SayGoodbye;
  2067. {  CloseGraph; }
  2068.   CloseVesa;
  2069. end.
  2070. ***************************************************
  2071.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  2072.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  2073. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  2074. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  2075. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  2076. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  2077.     Color := RandColor;
  2078.     SetColor(Color);
  2079.     SetFillStyle(Random(CloseDotFill)+1, Color);
  2080.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  2081.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  2082.   until KeyPressed;
  2083.   WaitToGo;
  2084. end; { RandBarPlay }
  2085.  
  2086. procedure ArcPlay;
  2087. { Draw random arcs on the screen }
  2088. var
  2089.   MaxRadius : word;
  2090.   EndAngle : word;
  2091.   ArcInfo : ArcCoordsType;
  2092. begin
  2093.   MainWindow('Arc / GetArcCoords demonstration');
  2094.   StatusLine('Esc aborts or press a key');
  2095.   MaxRadius := MaxY div 10;
  2096.   repeat
  2097.     SetColor(RandColor);
  2098.     EndAngle := Random(360);
  2099.     SetLineStyle(SolidLn, 0, NormWidth);
  2100.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  2101.     GetArcCoords(ArcInfo);
  2102.     with ArcInfo do
  2103.     begin
  2104.       Line(X, Y, XStart, YStart);
  2105.       Line(X, Y, Xend, Yend);
  2106.     end;
  2107.   until KeyPressed;
  2108.   WaitToGo;
  2109. end; { ArcPlay }
  2110.  
  2111. procedure PutPixelPlay;
  2112. { Demonstrate the PutPixel and GetPixel commands }
  2113. const
  2114.   Seed   = 1962; { A seed for the random number generator }
  2115.   NumPts = 2000; { The number of pixels plotted }
  2116.   Esc    = #27;
  2117. var
  2118.   I : word;
  2119.   X, Y, Color : word;
  2120.   XMax, YMax  : integer;
  2121.   ViewInfo    : ViewPortType;
  2122. begin
  2123.   MainWindow('PutPixel / GetPixel demonstration');
  2124.   StatusLine('Esc aborts or press a key...');
  2125.  
  2126.   GetViewSettings(ViewInfo);
  2127.   with ViewInfo do
  2128.   begin
  2129.     XMax := (x2-x1-1);
  2130.     YMax := (y2-y1-1);
  2131.   end;
  2132.  
  2133.   while not KeyPressed do
  2134.   begin
  2135.     { Plot random pixels }
  2136.     RandSeed := Seed;
  2137.     I := 0;
  2138.     while (not KeyPressed) and (I < NumPts) do
  2139.     begin
  2140.       Inc(I);
  2141.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  2142.     end;
  2143.  
  2144.     { Erase pixels }
  2145.     RandSeed := Seed;
  2146.     I := 0;
  2147.     while (not KeyPressed) and (I < NumPts) do
  2148.     begin
  2149.       Inc(I);
  2150.       X := Random(XMax)+1;
  2151.       Y := Random(YMax)+1;
  2152.       Color := GetPixel(X, Y);
  2153.         if Color = RandColor then
  2154.           PutPixel(X, Y, 0);
  2155.      end;
  2156.   end;
  2157.   WaitToGo;
  2158. end; { PutPixelPlay }
  2159.  
  2160. procedure PutImagePlay;
  2161. { Demonstrate the GetImage and PutImage commands }
  2162.  
  2163. const
  2164.   r  = 20;
  2165.   StartX = 100;
  2166.   StartY = 50;
  2167.  
  2168. var
  2169.   CurPort : ViewPortType;
  2170.  
  2171. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  2172. var
  2173.   Step : integer;
  2174. begin
  2175.   Step := Random(2*r);
  2176.   if Odd(Step) then
  2177.     Step := -Step;
  2178.   X := X + Step;
  2179.   Step := Random(r);
  2180.   if Odd(Step) then
  2181.     Step := -Step;
  2182.   Y := Y + Step;
  2183.  
  2184.   { Make saucer bounce off viewport walls }
  2185.   with CurPort do
  2186.   begin
  2187.     if (x1 + X + Width - 1 > x2) then
  2188.       X := x2-x1 - Width + 1
  2189.     else
  2190.       if (X < 0) then
  2191.         X := 0;
  2192.     if (y1 + Y + Height - 1 > y2) then
  2193.       Y := y2-y1 - Height + 1
  2194.     else
  2195.       if (Y < 0) then
  2196.         Y := 0;
  2197.   end;
  2198. end; { MoveSaucer }
  2199.  
  2200. var
  2201.   Pausetime : word;
  2202.   Saucer    : pointer;
  2203.   X, Y      : integer;
  2204.   ulx, uly  : word;
  2205.   lrx, lry  : word;
  2206.   Size      : word;
  2207.   I         : word;
  2208. begin
  2209.   ClearDevice;
  2210.   FullPort;
  2211.  
  2212.   { PaintScreen }
  2213.   ClearDevice;
  2214.   MainWindow('GetImage / PutImage Demonstration');
  2215.   StatusLine('Esc aborts or press a key...');
  2216.   GetViewSettings(CurPort);
  2217.  
  2218.   { DrawSaucer }
  2219.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  2220.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  2221.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  2222.   Circle(StartX+10, StartY-12, 2);
  2223.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  2224.   Circle(StartX-10, StartY-12, 2);
  2225.   SetFillStyle(SolidFill, MaxColor);
  2226.   FloodFill(StartX+1, StartY+4, GetColor);
  2227.  
  2228.   { ReadSaucerImage }
  2229.   ulx := StartX-(r+1);
  2230.   uly := StartY-14;
  2231.   lrx := StartX+(r+1);
  2232.   lry := StartY+(r div 3)+3;
  2233.  
  2234.   Size := ImageSize(ulx, uly, lrx, lry);
  2235.   GetMem(Saucer, Size);
  2236.   GetImage(ulx, uly, lrx, lry, Saucer^);
  2237. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  2238.  
  2239.   { Plot some "stars" }
  2240.   for I := 1 to 1000 do
  2241.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  2242.   X := MaxX div 2;
  2243.   Y := MaxY div 2;
  2244.   PauseTime := 70;
  2245.  
  2246.   { Move the saucer around }
  2247.   repeat
  2248. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  2249.      Delay(PauseTime);
  2250. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  2251.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  2252.   until KeyPressed;
  2253.   FreeMem(Saucer, size);
  2254.   WaitToGo;
  2255. end; { PutImagePlay }
  2256.  
  2257. procedure PolyPlay;
  2258. { Draw random polygons with random fill styles on the screen }
  2259. const
  2260.   MaxPts = 5;
  2261. type
  2262.   PolygonType = array[1..MaxPts] of PointType;
  2263. var
  2264.   Poly : PolygonType;
  2265.   I, Color : word;
  2266. begin
  2267.   MainWindow('FillPoly demonstration');
  2268.   StatusLine('Esc aborts or press a key...');
  2269.   repeat
  2270.     Color := RandColor;
  2271.     SetFillStyle(Random(11)+1, Color);
  2272.     SetColor(Color);
  2273.     for I := 1 to MaxPts do
  2274.       with Poly[I] do
  2275.       begin
  2276.         X := Random(MaxX);
  2277.         Y := Random(MaxY);
  2278.       end;
  2279.     FillPoly(MaxPts, Poly);
  2280.   until KeyPressed;
  2281.   WaitToGo;
  2282. end; { PolyPlay }
  2283.  
  2284. procedure FillStylePlay;
  2285. { Display all of the predefined fill styles available }
  2286. var
  2287.   Style    : word;
  2288.   Width    : word;
  2289.   Height   : word;
  2290.   X, Y     : word;
  2291.   I, J     : word;
  2292.   ViewInfo : ViewPortType;
  2293.  
  2294. procedure DrawBox(X, Y : word);
  2295. begin
  2296.   SetFillStyle(Style, MaxColor);
  2297.   with ViewInfo do
  2298.     Bar(X, Y, X+Width, Y+Height);
  2299.   Rectangle(X, Y, X+Width, Y+Height);
  2300.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  2301.   Inc(Style);
  2302. end; { DrawBox }
  2303.  
  2304. begin
  2305.   MainWindow('Pre-defined fill styles');
  2306.   GetViewSettings(ViewInfo);
  2307.   with ViewInfo do
  2308.   begin
  2309.     Width := 2 * ((x2+1) div 13);
  2310.     Height := 2 * ((y2-10) div 10);
  2311.   end;
  2312.   X := Width div 2;
  2313.   Y := Height div 2;
  2314.   Style := 0;
  2315.   for J := 1 to 3 do
  2316.   begin
  2317.     for I := 1 to 4 do
  2318.     begin
  2319.       DrawBox(X, Y);
  2320.       Inc(X, (Width div 2) * 3);
  2321.     end;
  2322.     X := Width div 2;
  2323.     Inc(Y, (Height div 2) * 3);
  2324.   end;
  2325.   SetTextJustify(LeftText, TopText);
  2326.   WaitToGo;
  2327. end; { FillStylePlay }
  2328.  
  2329. procedure FillPatternPlay;
  2330. { Display some user defined fill patterns }
  2331. const
  2332.   Patterns : array[0..11] of FillPatternType = (
  2333.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  2334.             OldColor which has a path of pixels of OldColor or NewColor
  2335.             with sides touching back to the seed point, (XSeed, YSeed).
  2336.             Therefore, only pixels of OldColor are modified and no other
  2337.             information is changed.
  2338.  
  2339.             SEE ALSO
  2340.  
  2341.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  2342.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  2343.             SETVIEW
  2344.  
  2345.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  2346.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  2347.             IF WHICHVGA = 0 THEN STOP
  2348.             DUMMY=RES640
  2349.             SETVIEW 100, 100, 539, 379
  2350.             FILLVIEW 10
  2351.             WHILE INKEY$ = ""
  2352.             WEND
  2353.             VIDEOMODESET VMODE
  2354.             END
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.                                                                          63
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.           FONTGETINFO
  2379.  
  2380.             PROTOTYPE
  2381.  
  2382.             SUB FONTGETINFO (Width%, Height%)
  2383.  
  2384.             INPUT
  2385.  
  2386.             no input parameters
  2387.     WEND
  2388.             MOUSEEXIT
  2389.             VIDEOMODESET VMODE
  2390.             END
  2391.  
  2392.  
  2393.  
  2394.  
  2395.  
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.                                                                          86
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.           MOUSECURSORDEFAULT
  2439.  
  2440.             PROTOTYPE
  2441.  
  2442.             SUB MOUSECURSORDEFAULT ()
  2443.  
  2444.             INPUT
  2445.  
  2446.             no input parameters
  2447.  
  2448.             OUTPUT
  2449.  
  2450.             no value returned
  2451.  
  2452.             USAGE
  2453.  
  2454.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  2455.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  2456. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  2457. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  2458. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  2459. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  2460. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  2461. $╤
  2462. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  2463. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  2464. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  2465. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  2466. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  2467. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  2468. ░£▒
  2469. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  2470. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  2471.       end;
  2472.     end;
  2473.   end;
  2474.   WaitToGo;
  2475. end; { UserLineStylePlay }
  2476.  
  2477.  
  2478. procedure SayGoodbye;
  2479. { Say goodbye and then exit the program }
  2480. var
  2481.   ViewInfo : ViewPortType;
  2482. begin
  2483.   MainWindow('');
  2484.   GetViewSettings(ViewInfo);
  2485.   SetTextStyle(TriplexFont, HorizDir, 4);
  2486.   SetTextJustify(CenterText, CenterText);
  2487.   with ViewInfo do
  2488.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  2489.   StatusLine('Press any key to quit...');
  2490.   repeat until KeyPressed;
  2491. end; { SayGoodbye }
  2492.  
  2493.  
  2494. PROCEDURE SelectMode;
  2495. VAR
  2496.     choice1,choice2     : CHAR;
  2497.    xsize,ysize            : WORD;
  2498. BEGIN
  2499.     (* Let's select a mode *)
  2500.     ClrScr;
  2501.     WriteLn('VESADEMO:');
  2502.     WriteLn('1. 256 colors');
  2503.     WriteLn('2. 32768 colors');
  2504.     WriteLn('3. 65536 colors');
  2505.     WriteLn('4. 16777216 colors');
  2506.     WriteLn('Q uit');
  2507.     WriteLn;
  2508.     Write('Your choice: ');
  2509.     REPEAT
  2510.         ReadLn(choice1);
  2511.       IF choice1 <> '1' THEN BEGIN
  2512.           WriteLn('Sorry !');
  2513.          WriteLn('This demo wasn''t written for more as 256 colors !');
  2514.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  2515.          WriteLn('Switching to 256 colors.');
  2516.          choice1 := '1';
  2517.       END;
  2518.     UNTIL choice1 IN ['1'..'4','q'];
  2519.     IF choice1 = 'q' THEN Halt;
  2520.  
  2521.     WriteLn;
  2522.     WriteLn;
  2523.     WriteLn('a. 320x200');
  2524.     WriteLn('b. 640x480');
  2525.     WriteLn('c. 800x600');
  2526.     WriteLn('d. 1024x768');
  2527.     WriteLn('e. 1280x1024');
  2528.     WriteLn('Q uit');
  2529.     WriteLn;
  2530.     Write('Your choice: ');
  2531.     REPEAT
  2532.         ReadLn(choice2);
  2533.     UNTIL choice2 IN ['a'..'e','q'];
  2534.     IF choice2 = 'q' THEN Halt;
  2535.  
  2536.     CASE choice2 OF
  2537.         'a' : BEGIN
  2538.             xsize := 320;
  2539.             ysize := 200;
  2540.         END;
  2541.         'b' : BEGIN
  2542.             xsize := 640;
  2543.             ysize := 480;
  2544.         END;
  2545.         'c' : BEGIN
  2546.             xsize := 800;
  2547.             ysize := 600;
  2548.         END;
  2549.         'd' : BEGIN
  2550.             xsize := 1024;
  2551.             ysize := 768;
  2552.         END;
  2553.         'e' : BEGIN
  2554.             xsize := 1280;
  2555.             ysize := 1024;
  2556.         END;
  2557.     END;
  2558.     CASE choice1 OF
  2559.         '1' : mode := FindVesaMode(xsize,ysize,8);
  2560.         '2' : mode := FindVesaMode(xsize,ysize,15);
  2561.         '3' : mode := FindVesaMode(xsize,ysize,16);
  2562.         '4' : mode := FindVesaMode(xsize,ysize,24);
  2563.     END;
  2564.     IF mode = 0 THEN BEGIN
  2565.         WriteLn('No such mode could be found !');
  2566.         WriteLn('Switching to to 320x200.');
  2567.         ReadKey;
  2568.         mode := V320x200x256;
  2569.     END;
  2570. END;
  2571.  
  2572. begin { program body }
  2573.   SelectMode;
  2574.   Initialize;
  2575.   ReportStatus;
  2576.  
  2577. {  AspectRatioPlay; }
  2578.   FillEllipsePlay;
  2579.   SectorPlay;
  2580.   WriteModePlay;
  2581.  
  2582.   ColorPlay;
  2583.   { PalettePlay only intended to work on these drivers: }
  2584.   if (GraphDriver = EGA) or
  2585.       (GraphDriver = EGA64) or
  2586.       (GraphDriver = VGA) then
  2587.      PalettePlay;
  2588.   PutPixelPlay;
  2589. {  PutImagePlay; }
  2590.   RandBarPlay;
  2591.   BarPlay;
  2592.   Bar3DPlay;
  2593.   ArcPlay;
  2594.   CirclePlay;
  2595.   PiePlay;
  2596.   LineToPlay;
  2597.   LineRelPlay;
  2598. {  LineStylePlay; }
  2599. {  UserLineStylePlay; }
  2600.   TextDump;
  2601.   TextPlay;
  2602.   CrtModePlay;
  2603.   FillStylePlay;
  2604.   FillPatternPlay;
  2605.   PolyPlay;
  2606.   SayGoodbye;
  2607. {  CloseGraph; }
  2608.   CloseVesa;
  2609. end.
  2610. ***************************************************
  2611.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  2612.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  2613. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  2614. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  2615. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  2616. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  2617.     Color := RandColor;
  2618.     SetColor(Color);
  2619.     SetFillStyle(Random(CloseDotFill)+1, Color);
  2620.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  2621.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  2622.   until KeyPressed;
  2623.   WaitToGo;
  2624. end; { RandBarPlay }
  2625.  
  2626. procedure ArcPlay;
  2627. { Draw random arcs on the screen }
  2628. var
  2629.   MaxRadius : word;
  2630.   EndAngle : word;
  2631.   ArcInfo : ArcCoordsType;
  2632. begin
  2633.   MainWindow('Arc / GetArcCoords demonstration');
  2634.   StatusLine('Esc aborts or press a key');
  2635.   MaxRadius := MaxY div 10;
  2636.   repeat
  2637.     SetColor(RandColor);
  2638.     EndAngle := Random(360);
  2639.     SetLineStyle(SolidLn, 0, NormWidth);
  2640.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  2641.     GetArcCoords(ArcInfo);
  2642.     with ArcInfo do
  2643.     begin
  2644.       Line(X, Y, XStart, YStart);
  2645.       Line(X, Y, Xend, Yend);
  2646.     end;
  2647.   until KeyPressed;
  2648.   WaitToGo;
  2649. end; { ArcPlay }
  2650.  
  2651. procedure PutPixelPlay;
  2652. { Demonstrate the PutPixel and GetPixel commands }
  2653. const
  2654.   Seed   = 1962; { A seed for the random number generator }
  2655.   NumPts = 2000; { The number of pixels plotted }
  2656.   Esc    = #27;
  2657. var
  2658.   I : word;
  2659.   X, Y, Color : word;
  2660.   XMax, YMax  : integer;
  2661.   ViewInfo    : ViewPortType;
  2662. begin
  2663.   MainWindow('PutPixel / GetPixel demonstration');
  2664.   StatusLine('Esc aborts or press a key...');
  2665.  
  2666.   GetViewSettings(ViewInfo);
  2667.   with ViewInfo do
  2668.   begin
  2669.     XMax := (x2-x1-1);
  2670.     YMax := (y2-y1-1);
  2671.   end;
  2672.  
  2673.   while not KeyPressed do
  2674.   begin
  2675.     { Plot random pixels }
  2676.     RandSeed := Seed;
  2677.     I := 0;
  2678.     while (not KeyPressed) and (I < NumPts) do
  2679.     begin
  2680.       Inc(I);
  2681.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  2682.     end;
  2683.  
  2684.     { Erase pixels }
  2685.     RandSeed := Seed;
  2686.     I := 0;
  2687.     while (not KeyPressed) and (I < NumPts) do
  2688.     begin
  2689.       Inc(I);
  2690.       X := Random(XMax)+1;
  2691.       Y := Random(YMax)+1;
  2692.       Color := GetPixel(X, Y);
  2693.         if Color = RandColor then
  2694.           PutPixel(X, Y, 0);
  2695.      end;
  2696.   end;
  2697.   WaitToGo;
  2698. end; { PutPixelPlay }
  2699.  
  2700. procedure PutImagePlay;
  2701. { Demonstrate the GetImage and PutImage commands }
  2702.  
  2703. const
  2704.   r  = 20;
  2705.   StartX = 100;
  2706.   StartY = 50;
  2707.  
  2708. var
  2709.   CurPort : ViewPortType;
  2710.  
  2711. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  2712. var
  2713.   Step : integer;
  2714. begin
  2715.   Step := Random(2*r);
  2716.   if Odd(Step) then
  2717.     Step := -Step;
  2718.   X := X + Step;
  2719.   Step := Random(r);
  2720.   if Odd(Step) then
  2721.     Step := -Step;
  2722.   Y := Y + Step;
  2723.  
  2724.   { Make saucer bounce off viewport walls }
  2725.   with CurPort do
  2726.   begin
  2727.     if (x1 + X + Width - 1 > x2) then
  2728.       X := x2-x1 - Width + 1
  2729.     else
  2730.       if (X < 0) then
  2731.         X := 0;
  2732.     if (y1 + Y + Height - 1 > y2) then
  2733.       Y := y2-y1 - Height + 1
  2734.     else
  2735.       if (Y < 0) then
  2736.         Y := 0;
  2737.   end;
  2738. end; { MoveSaucer }
  2739.  
  2740. var
  2741.   Pausetime : word;
  2742.   Saucer    : pointer;
  2743.   X, Y      : integer;
  2744.   ulx, uly  : word;
  2745.   lrx, lry  : word;
  2746.   Size      : word;
  2747.   I         : word;
  2748. begin
  2749.   ClearDevice;
  2750.   FullPort;
  2751.  
  2752.   { PaintScreen }
  2753.   ClearDevice;
  2754.   MainWindow('GetImage / PutImage Demonstration');
  2755.   StatusLine('Esc aborts or press a key...');
  2756.   GetViewSettings(CurPort);
  2757.  
  2758.   { DrawSaucer }
  2759.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  2760.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  2761.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  2762.   Circle(StartX+10, StartY-12, 2);
  2763.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  2764.   Circle(StartX-10, StartY-12, 2);
  2765.   SetFillStyle(SolidFill, MaxColor);
  2766.   FloodFill(StartX+1, StartY+4, GetColor);
  2767.  
  2768.   { ReadSaucerImage }
  2769.   ulx := StartX-(r+1);
  2770.   uly := StartY-14;
  2771.   lrx := StartX+(r+1);
  2772.   lry := StartY+(r div 3)+3;
  2773.  
  2774.   Size := ImageSize(ulx, uly, lrx, lry);
  2775.   GetMem(Saucer, Size);
  2776.   GetImage(ulx, uly, lrx, lry, Saucer^);
  2777. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  2778.  
  2779.   { Plot some "stars" }
  2780.   for I := 1 to 1000 do
  2781.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  2782.   X := MaxX div 2;
  2783.   Y := MaxY div 2;
  2784.   PauseTime := 70;
  2785.  
  2786.   { Move the saucer around }
  2787.   repeat
  2788. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  2789.      Delay(PauseTime);
  2790. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  2791.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  2792.   until KeyPressed;
  2793.   FreeMem(Saucer, size);
  2794.   WaitToGo;
  2795. end; { PutImagePlay }
  2796.  
  2797. procedure PolyPlay;
  2798. { Draw random polygons with random fill styles on the screen }
  2799. const
  2800.   MaxPts = 5;
  2801. type
  2802.   PolygonType = array[1..MaxPts] of PointType;
  2803. var
  2804.   Poly : PolygonType;
  2805.   I, Color : word;
  2806. begin
  2807.   MainWindow('FillPoly demonstration');
  2808.   StatusLine('Esc aborts or press a key...');
  2809.   repeat
  2810.     Color := RandColor;
  2811.     SetFillStyle(Random(11)+1, Color);
  2812.     SetColor(Color);
  2813.     for I := 1 to MaxPts do
  2814.       with Poly[I] do
  2815.       begin
  2816.         X := Random(MaxX);
  2817.         Y := Random(MaxY);
  2818.       end;
  2819.     FillPoly(MaxPts, Poly);
  2820.   until KeyPressed;
  2821.   WaitToGo;
  2822. end; { PolyPlay }
  2823.  
  2824. procedure FillStylePlay;
  2825. { Display all of the predefined fill styles available }
  2826. var
  2827.   Style    : word;
  2828.   Width    : word;
  2829.   Height   : word;
  2830.   X, Y     : word;
  2831.   I, J     : word;
  2832.   ViewInfo : ViewPortType;
  2833.  
  2834. procedure DrawBox(X, Y : word);
  2835. begin
  2836.   SetFillStyle(Style, MaxColor);
  2837.   with ViewInfo do
  2838.     Bar(X, Y, X+Width, Y+Height);
  2839.   Rectangle(X, Y, X+Width, Y+Height);
  2840.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  2841.   Inc(Style);
  2842. end; { DrawBox }
  2843.  
  2844. begin
  2845.   MainWindow('Pre-defined fill styles');
  2846.   GetViewSettings(ViewInfo);
  2847.   with ViewInfo do
  2848.   begin
  2849.     Width := 2 * ((x2+1) div 13);
  2850.     Height := 2 * ((y2-10) div 10);
  2851.   end;
  2852.   X := Width div 2;
  2853.   Y := Height div 2;
  2854.   Style := 0;
  2855.   for J := 1 to 3 do
  2856.   begin
  2857.     for I := 1 to 4 do
  2858.     begin
  2859.       DrawBox(X, Y);
  2860.       Inc(X, (Width div 2) * 3);
  2861.     end;
  2862.     X := Width div 2;
  2863.     Inc(Y, (Height div 2) * 3);
  2864.   end;
  2865.   SetTextJustify(LeftText, TopText);
  2866.   WaitToGo;
  2867. end; { FillStylePlay }
  2868.  
  2869. procedure FillPatternPlay;
  2870. { Display some user defined fill patterns }
  2871. const
  2872.   Patterns : array[0..11] of FillPatternType = (
  2873.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  2874.             OldColor which has a path of pixels of OldColor or NewColor
  2875.             with sides touching back to the seed point, (XSeed, YSeed).
  2876.             Therefore, only pixels of OldColor are modified and no other
  2877.             information is changed.
  2878.  
  2879.             SEE ALSO
  2880.  
  2881.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  2882.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  2883.             SETVIEW
  2884.  
  2885.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  2886.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  2887.             IF WHICHVGA = 0 THEN STOP
  2888.             DUMMY=RES640
  2889.             SETVIEW 100, 100, 539, 379
  2890.             FILLVIEW 10
  2891.             WHILE INKEY$ = ""
  2892.             WEND
  2893.             VIDEOMODESET VMODE
  2894.             END
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.                                                                          63
  2912.  
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918.           FONTGETINFO
  2919.  
  2920.             PROTOTYPE
  2921.  
  2922.             SUB FONTGETINFO (Width%, Height%)
  2923.  
  2924.             INPUT
  2925.  
  2926.             no input parameters
  2927.     WEND
  2928.             MOUSEEXIT
  2929.             VIDEOMODESET VMODE
  2930.             END
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.                                                                          86
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.           MOUSECURSORDEFAULT
  2979.  
  2980.             PROTOTYPE
  2981.  
  2982.             SUB MOUSECURSORDEFAULT ()
  2983.  
  2984.             INPUT
  2985.  
  2986.             no input parameters
  2987.  
  2988.             OUTPUT
  2989.  
  2990.             no value returned
  2991.  
  2992.             USAGE
  2993.  
  2994.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  2995.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  2996. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  2997. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  2998. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  2999. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  3000. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  3001. $╤
  3002. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  3003. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  3004. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  3005. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  3006. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  3007. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  3008. ░£▒
  3009. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  3010. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  3011.       end;
  3012.     end;
  3013.   end;
  3014.   WaitToGo;
  3015. end; { UserLineStylePlay }
  3016.  
  3017.  
  3018. procedure SayGoodbye;
  3019. { Say goodbye and then exit the program }
  3020. var
  3021.   ViewInfo : ViewPortType;
  3022. begin
  3023.   MainWindow('');
  3024.   GetViewSettings(ViewInfo);
  3025.   SetTextStyle(TriplexFont, HorizDir, 4);
  3026.   SetTextJustify(CenterText, CenterText);
  3027.   with ViewInfo do
  3028.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  3029.   StatusLine('Press any key to quit...');
  3030.   repeat until KeyPressed;
  3031. end; { SayGoodbye }
  3032.  
  3033.  
  3034. PROCEDURE SelectMode;
  3035. VAR
  3036.     choice1,choice2     : CHAR;
  3037.    xsize,ysize            : WORD;
  3038. BEGIN
  3039.     (* Let's select a mode *)
  3040.     ClrScr;
  3041.     WriteLn('VESADEMO:');
  3042.     WriteLn('1. 256 colors');
  3043.     WriteLn('2. 32768 colors');
  3044.     WriteLn('3. 65536 colors');
  3045.     WriteLn('4. 16777216 colors');
  3046.     WriteLn('Q uit');
  3047.     WriteLn;
  3048.     Write('Your choice: ');
  3049.     REPEAT
  3050.         ReadLn(choice1);
  3051.       IF choice1 <> '1' THEN BEGIN
  3052.           WriteLn('Sorry !');
  3053.          WriteLn('This demo wasn''t written for more as 256 colors !');
  3054.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  3055.          WriteLn('Switching to 256 colors.');
  3056.          choice1 := '1';
  3057.       END;
  3058.     UNTIL choice1 IN ['1'..'4','q'];
  3059.     IF choice1 = 'q' THEN Halt;
  3060.  
  3061.     WriteLn;
  3062.     WriteLn;
  3063.     WriteLn('a. 320x200');
  3064.     WriteLn('b. 640x480');
  3065.     WriteLn('c. 800x600');
  3066.     WriteLn('d. 1024x768');
  3067.     WriteLn('e. 1280x1024');
  3068.     WriteLn('Q uit');
  3069.     WriteLn;
  3070.     Write('Your choice: ');
  3071.     REPEAT
  3072.         ReadLn(choice2);
  3073.     UNTIL choice2 IN ['a'..'e','q'];
  3074.     IF choice2 = 'q' THEN Halt;
  3075.  
  3076.     CASE choice2 OF
  3077.         'a' : BEGIN
  3078.             xsize := 320;
  3079.             ysize := 200;
  3080.         END;
  3081.         'b' : BEGIN
  3082.             xsize := 640;
  3083.             ysize := 480;
  3084.         END;
  3085.         'c' : BEGIN
  3086.             xsize := 800;
  3087.             ysize := 600;
  3088.         END;
  3089.         'd' : BEGIN
  3090.             xsize := 1024;
  3091.             ysize := 768;
  3092.         END;
  3093.         'e' : BEGIN
  3094.             xsize := 1280;
  3095.             ysize := 1024;
  3096.         END;
  3097.     END;
  3098.     CASE choice1 OF
  3099.         '1' : mode := FindVesaMode(xsize,ysize,8);
  3100.         '2' : mode := FindVesaMode(xsize,ysize,15);
  3101.         '3' : mode := FindVesaMode(xsize,ysize,16);
  3102.         '4' : mode := FindVesaMode(xsize,ysize,24);
  3103.     END;
  3104.     IF mode = 0 THEN BEGIN
  3105.         WriteLn('No such mode could be found !');
  3106.         WriteLn('Switching to to 320x200.');
  3107.         ReadKey;
  3108.         mode := V320x200x256;
  3109.     END;
  3110. END;
  3111.  
  3112. begin { program body }
  3113.   SelectMode;
  3114.   Initialize;
  3115.   ReportStatus;
  3116.  
  3117. {  AspectRatioPlay; }
  3118.   FillEllipsePlay;
  3119.   SectorPlay;
  3120.   WriteModePlay;
  3121.  
  3122.   ColorPlay;
  3123.   { PalettePlay only intended to work on these drivers: }
  3124.   if (GraphDriver = EGA) or
  3125.       (GraphDriver = EGA64) or
  3126.       (GraphDriver = VGA) then
  3127.      PalettePlay;
  3128.   PutPixelPlay;
  3129. {  PutImagePlay; }
  3130.   RandBarPlay;
  3131.   BarPlay;
  3132.   Bar3DPlay;
  3133.   ArcPlay;
  3134.   CirclePlay;
  3135.   PiePlay;
  3136.   LineToPlay;
  3137.   LineRelPlay;
  3138. {  LineStylePlay; }
  3139. {  UserLineStylePlay; }
  3140.   TextDump;
  3141.   TextPlay;
  3142.   CrtModePlay;
  3143.   FillStylePlay;
  3144.   FillPatternPlay;
  3145.   PolyPlay;
  3146.   SayGoodbye;
  3147. {  CloseGraph; }
  3148.   CloseVesa;
  3149. end.
  3150. ***************************************************
  3151.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  3152.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  3153. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  3154. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  3155. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  3156. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  3157.     Color := RandColor;
  3158.     SetColor(Color);
  3159.     SetFillStyle(Random(CloseDotFill)+1, Color);
  3160.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  3161.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  3162.   until KeyPressed;
  3163.   WaitToGo;
  3164. end; { RandBarPlay }
  3165.  
  3166. procedure ArcPlay;
  3167. { Draw random arcs on the screen }
  3168. var
  3169.   MaxRadius : word;
  3170.   EndAngle : word;
  3171.   ArcInfo : ArcCoordsType;
  3172. begin
  3173.   MainWindow('Arc / GetArcCoords demonstration');
  3174.   StatusLine('Esc aborts or press a key');
  3175.   MaxRadius := MaxY div 10;
  3176.   repeat
  3177.     SetColor(RandColor);
  3178.     EndAngle := Random(360);
  3179.     SetLineStyle(SolidLn, 0, NormWidth);
  3180.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  3181.     GetArcCoords(ArcInfo);
  3182.     with ArcInfo do
  3183.     begin
  3184.       Line(X, Y, XStart, YStart);
  3185.       Line(X, Y, Xend, Yend);
  3186.     end;
  3187.   until KeyPressed;
  3188.   WaitToGo;
  3189. end; { ArcPlay }
  3190.  
  3191. procedure PutPixelPlay;
  3192. { Demonstrate the PutPixel and GetPixel commands }
  3193. const
  3194.   Seed   = 1962; { A seed for the random number generator }
  3195.   NumPts = 2000; { The number of pixels plotted }
  3196.   Esc    = #27;
  3197. var
  3198.   I : word;
  3199.   X, Y, Color : word;
  3200.   XMax, YMax  : integer;
  3201.   ViewInfo    : ViewPortType;
  3202. begin
  3203.   MainWindow('PutPixel / GetPixel demonstration');
  3204.   StatusLine('Esc aborts or press a key...');
  3205.  
  3206.   GetViewSettings(ViewInfo);
  3207.   with ViewInfo do
  3208.   begin
  3209.     XMax := (x2-x1-1);
  3210.     YMax := (y2-y1-1);
  3211.   end;
  3212.  
  3213.   while not KeyPressed do
  3214.   begin
  3215.     { Plot random pixels }
  3216.     RandSeed := Seed;
  3217.     I := 0;
  3218.     while (not KeyPressed) and (I < NumPts) do
  3219.     begin
  3220.       Inc(I);
  3221.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  3222.     end;
  3223.  
  3224.     { Erase pixels }
  3225.     RandSeed := Seed;
  3226.     I := 0;
  3227.     while (not KeyPressed) and (I < NumPts) do
  3228.     begin
  3229.       Inc(I);
  3230.       X := Random(XMax)+1;
  3231.       Y := Random(YMax)+1;
  3232.       Color := GetPixel(X, Y);
  3233.         if Color = RandColor then
  3234.           PutPixel(X, Y, 0);
  3235.      end;
  3236.   end;
  3237.   WaitToGo;
  3238. end; { PutPixelPlay }
  3239.  
  3240. procedure PutImagePlay;
  3241. { Demonstrate the GetImage and PutImage commands }
  3242.  
  3243. const
  3244.   r  = 20;
  3245.   StartX = 100;
  3246.   StartY = 50;
  3247.  
  3248. var
  3249.   CurPort : ViewPortType;
  3250.  
  3251. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  3252. var
  3253.   Step : integer;
  3254. begin
  3255.   Step := Random(2*r);
  3256.   if Odd(Step) then
  3257.     Step := -Step;
  3258.   X := X + Step;
  3259.   Step := Random(r);
  3260.   if Odd(Step) then
  3261.     Step := -Step;
  3262.   Y := Y + Step;
  3263.  
  3264.   { Make saucer bounce off viewport walls }
  3265.   with CurPort do
  3266.   begin
  3267.     if (x1 + X + Width - 1 > x2) then
  3268.       X := x2-x1 - Width + 1
  3269.     else
  3270.       if (X < 0) then
  3271.         X := 0;
  3272.     if (y1 + Y + Height - 1 > y2) then
  3273.       Y := y2-y1 - Height + 1
  3274.     else
  3275.       if (Y < 0) then
  3276.         Y := 0;
  3277.   end;
  3278. end; { MoveSaucer }
  3279.  
  3280. var
  3281.   Pausetime : word;
  3282.   Saucer    : pointer;
  3283.   X, Y      : integer;
  3284.   ulx, uly  : word;
  3285.   lrx, lry  : word;
  3286.   Size      : word;
  3287.   I         : word;
  3288. begin
  3289.   ClearDevice;
  3290.   FullPort;
  3291.  
  3292.   { PaintScreen }
  3293.   ClearDevice;
  3294.   MainWindow('GetImage / PutImage Demonstration');
  3295.   StatusLine('Esc aborts or press a key...');
  3296.   GetViewSettings(CurPort);
  3297.  
  3298.   { DrawSaucer }
  3299.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  3300.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  3301.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  3302.   Circle(StartX+10, StartY-12, 2);
  3303.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  3304.   Circle(StartX-10, StartY-12, 2);
  3305.   SetFillStyle(SolidFill, MaxColor);
  3306.   FloodFill(StartX+1, StartY+4, GetColor);
  3307.  
  3308.   { ReadSaucerImage }
  3309.   ulx := StartX-(r+1);
  3310.   uly := StartY-14;
  3311.   lrx := StartX+(r+1);
  3312.   lry := StartY+(r div 3)+3;
  3313.  
  3314.   Size := ImageSize(ulx, uly, lrx, lry);
  3315.   GetMem(Saucer, Size);
  3316.   GetImage(ulx, uly, lrx, lry, Saucer^);
  3317. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  3318.  
  3319.   { Plot some "stars" }
  3320.   for I := 1 to 1000 do
  3321.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  3322.   X := MaxX div 2;
  3323.   Y := MaxY div 2;
  3324.   PauseTime := 70;
  3325.  
  3326.   { Move the saucer around }
  3327.   repeat
  3328. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  3329.      Delay(PauseTime);
  3330. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  3331.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  3332.   until KeyPressed;
  3333.   FreeMem(Saucer, size);
  3334.   WaitToGo;
  3335. end; { PutImagePlay }
  3336.  
  3337. procedure PolyPlay;
  3338. { Draw random polygons with random fill styles on the screen }
  3339. const
  3340.   MaxPts = 5;
  3341. type
  3342.   PolygonType = array[1..MaxPts] of PointType;
  3343. var
  3344.   Poly : PolygonType;
  3345.   I, Color : word;
  3346. begin
  3347.   MainWindow('FillPoly demonstration');
  3348.   StatusLine('Esc aborts or press a key...');
  3349.   repeat
  3350.     Color := RandColor;
  3351.     SetFillStyle(Random(11)+1, Color);
  3352.     SetColor(Color);
  3353.     for I := 1 to MaxPts do
  3354.       with Poly[I] do
  3355.       begin
  3356.         X := Random(MaxX);
  3357.         Y := Random(MaxY);
  3358.       end;
  3359.     FillPoly(MaxPts, Poly);
  3360.   until KeyPressed;
  3361.   WaitToGo;
  3362. end; { PolyPlay }
  3363.  
  3364. procedure FillStylePlay;
  3365. { Display all of the predefined fill styles available }
  3366. var
  3367.   Style    : word;
  3368.   Width    : word;
  3369.   Height   : word;
  3370.   X, Y     : word;
  3371.   I, J     : word;
  3372.   ViewInfo : ViewPortType;
  3373.  
  3374. procedure DrawBox(X, Y : word);
  3375. begin
  3376.   SetFillStyle(Style, MaxColor);
  3377.   with ViewInfo do
  3378.     Bar(X, Y, X+Width, Y+Height);
  3379.   Rectangle(X, Y, X+Width, Y+Height);
  3380.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  3381.   Inc(Style);
  3382. end; { DrawBox }
  3383.  
  3384. begin
  3385.   MainWindow('Pre-defined fill styles');
  3386.   GetViewSettings(ViewInfo);
  3387.   with ViewInfo do
  3388.   begin
  3389.     Width := 2 * ((x2+1) div 13);
  3390.     Height := 2 * ((y2-10) div 10);
  3391.   end;
  3392.   X := Width div 2;
  3393.   Y := Height div 2;
  3394.   Style := 0;
  3395.   for J := 1 to 3 do
  3396.   begin
  3397.     for I := 1 to 4 do
  3398.     begin
  3399.       DrawBox(X, Y);
  3400.       Inc(X, (Width div 2) * 3);
  3401.     end;
  3402.     X := Width div 2;
  3403.     Inc(Y, (Height div 2) * 3);
  3404.   end;
  3405.   SetTextJustify(LeftText, TopText);
  3406.   WaitToGo;
  3407. end; { FillStylePlay }
  3408.  
  3409. procedure FillPatternPlay;
  3410. { Display some user defined fill patterns }
  3411. const
  3412.   Patterns : array[0..11] of FillPatternType = (
  3413.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  3414.             OldColor which has a path of pixels of OldColor or NewColor
  3415.             with sides touching back to the seed point, (XSeed, YSeed).
  3416.             Therefore, only pixels of OldColor are modified and no other
  3417.             information is changed.
  3418.  
  3419.             SEE ALSO
  3420.  
  3421.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  3422.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  3423.             SETVIEW
  3424.  
  3425.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  3426.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  3427.             IF WHICHVGA = 0 THEN STOP
  3428.             DUMMY=RES640
  3429.             SETVIEW 100, 100, 539, 379
  3430.             FILLVIEW 10
  3431.             WHILE INKEY$ = ""
  3432.             WEND
  3433.             VIDEOMODESET VMODE
  3434.             END
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448.  
  3449.  
  3450.  
  3451.                                                                          63
  3452.  
  3453.  
  3454.  
  3455.  
  3456.  
  3457.  
  3458.           FONTGETINFO
  3459.  
  3460.             PROTOTYPE
  3461.  
  3462.             SUB FONTGETINFO (Width%, Height%)
  3463.  
  3464.             INPUT
  3465.  
  3466.             no input parameters
  3467.     WEND
  3468.             MOUSEEXIT
  3469.             VIDEOMODESET VMODE
  3470.             END
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.                                                                          86
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.           MOUSECURSORDEFAULT
  3519.  
  3520.             PROTOTYPE
  3521.  
  3522.             SUB MOUSECURSORDEFAULT ()
  3523.  
  3524.             INPUT
  3525.  
  3526.             no input parameters
  3527.  
  3528.             OUTPUT
  3529.  
  3530.             no value returned
  3531.  
  3532.             USAGE
  3533.  
  3534.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  3535.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  3536. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  3537. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  3538. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  3539. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  3540. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  3541. $╤
  3542. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  3543. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  3544. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  3545. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  3546. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  3547. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  3548. ░£▒
  3549. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  3550. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  3551.       end;
  3552.     end;
  3553.   end;
  3554.   WaitToGo;
  3555. end; { UserLineStylePlay }
  3556.  
  3557.  
  3558. procedure SayGoodbye;
  3559. { Say goodbye and then exit the program }
  3560. var
  3561.   ViewInfo : ViewPortType;
  3562. begin
  3563.   MainWindow('');
  3564.   GetViewSettings(ViewInfo);
  3565.   SetTextStyle(TriplexFont, HorizDir, 4);
  3566.   SetTextJustify(CenterText, CenterText);
  3567.   with ViewInfo do
  3568.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  3569.   StatusLine('Press any key to quit...');
  3570.   repeat until KeyPressed;
  3571. end; { SayGoodbye }
  3572.  
  3573.  
  3574. PROCEDURE SelectMode;
  3575. VAR
  3576.     choice1,choice2     : CHAR;
  3577.    xsize,ysize            : WORD;
  3578. BEGIN
  3579.     (* Let's select a mode *)
  3580.     ClrScr;
  3581.     WriteLn('VESADEMO:');
  3582.     WriteLn('1. 256 colors');
  3583.     WriteLn('2. 32768 colors');
  3584.     WriteLn('3. 65536 colors');
  3585.     WriteLn('4. 16777216 colors');
  3586.     WriteLn('Q uit');
  3587.     WriteLn;
  3588.     Write('Your choice: ');
  3589.     REPEAT
  3590.         ReadLn(choice1);
  3591.       IF choice1 <> '1' THEN BEGIN
  3592.           WriteLn('Sorry !');
  3593.          WriteLn('This demo wasn''t written for more as 256 colors !');
  3594.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  3595.          WriteLn('Switching to 256 colors.');
  3596.          choice1 := '1';
  3597.       END;
  3598.     UNTIL choice1 IN ['1'..'4','q'];
  3599.     IF choice1 = 'q' THEN Halt;
  3600.  
  3601.     WriteLn;
  3602.     WriteLn;
  3603.     WriteLn('a. 320x200');
  3604.     WriteLn('b. 640x480');
  3605.     WriteLn('c. 800x600');
  3606.     WriteLn('d. 1024x768');
  3607.     WriteLn('e. 1280x1024');
  3608.     WriteLn('Q uit');
  3609.     WriteLn;
  3610.     Write('Your choice: ');
  3611.     REPEAT
  3612.         ReadLn(choice2);
  3613.     UNTIL choice2 IN ['a'..'e','q'];
  3614.     IF choice2 = 'q' THEN Halt;
  3615.  
  3616.     CASE choice2 OF
  3617.         'a' : BEGIN
  3618.             xsize := 320;
  3619.             ysize := 200;
  3620.         END;
  3621.         'b' : BEGIN
  3622.             xsize := 640;
  3623.             ysize := 480;
  3624.         END;
  3625.         'c' : BEGIN
  3626.             xsize := 800;
  3627.             ysize := 600;
  3628.         END;
  3629.         'd' : BEGIN
  3630.             xsize := 1024;
  3631.             ysize := 768;
  3632.         END;
  3633.         'e' : BEGIN
  3634.             xsize := 1280;
  3635.             ysize := 1024;
  3636.         END;
  3637.     END;
  3638.     CASE choice1 OF
  3639.         '1' : mode := FindVesaMode(xsize,ysize,8);
  3640.         '2' : mode := FindVesaMode(xsize,ysize,15);
  3641.         '3' : mode := FindVesaMode(xsize,ysize,16);
  3642.         '4' : mode := FindVesaMode(xsize,ysize,24);
  3643.     END;
  3644.     IF mode = 0 THEN BEGIN
  3645.         WriteLn('No such mode could be found !');
  3646.         WriteLn('Switching to to 320x200.');
  3647.         ReadKey;
  3648.         mode := V320x200x256;
  3649.     END;
  3650. END;
  3651.  
  3652. begin { program body }
  3653.   SelectMode;
  3654.   Initialize;
  3655.   ReportStatus;
  3656.  
  3657. {  AspectRatioPlay; }
  3658.   FillEllipsePlay;
  3659.   SectorPlay;
  3660.   WriteModePlay;
  3661.  
  3662.   ColorPlay;
  3663.   { PalettePlay only intended to work on these drivers: }
  3664.   if (GraphDriver = EGA) or
  3665.       (GraphDriver = EGA64) or
  3666.       (GraphDriver = VGA) then
  3667.      PalettePlay;
  3668.   PutPixelPlay;
  3669. {  PutImagePlay; }
  3670.   RandBarPlay;
  3671.   BarPlay;
  3672.   Bar3DPlay;
  3673.   ArcPlay;
  3674.   CirclePlay;
  3675.   PiePlay;
  3676.   LineToPlay;
  3677.   LineRelPlay;
  3678. {  LineStylePlay; }
  3679. {  UserLineStylePlay; }
  3680.   TextDump;
  3681.   TextPlay;
  3682.   CrtModePlay;
  3683.   FillStylePlay;
  3684.   FillPatternPlay;
  3685.   PolyPlay;
  3686.   SayGoodbye;
  3687. {  CloseGraph; }
  3688.   CloseVesa;
  3689. end.
  3690. ***************************************************
  3691.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  3692.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  3693. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  3694. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  3695. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  3696. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  3697.     Color := RandColor;
  3698.     SetColor(Color);
  3699.     SetFillStyle(Random(CloseDotFill)+1, Color);
  3700.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  3701.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  3702.   until KeyPressed;
  3703.   WaitToGo;
  3704. end; { RandBarPlay }
  3705.  
  3706. procedure ArcPlay;
  3707. { Draw random arcs on the screen }
  3708. var
  3709.   MaxRadius : word;
  3710.   EndAngle : word;
  3711.   ArcInfo : ArcCoordsType;
  3712. begin
  3713.   MainWindow('Arc / GetArcCoords demonstration');
  3714.   StatusLine('Esc aborts or press a key');
  3715.   MaxRadius := MaxY div 10;
  3716.   repeat
  3717.     SetColor(RandColor);
  3718.     EndAngle := Random(360);
  3719.     SetLineStyle(SolidLn, 0, NormWidth);
  3720.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  3721.     GetArcCoords(ArcInfo);
  3722.     with ArcInfo do
  3723.     begin
  3724.       Line(X, Y, XStart, YStart);
  3725.       Line(X, Y, Xend, Yend);
  3726.     end;
  3727.   until KeyPressed;
  3728.   WaitToGo;
  3729. end; { ArcPlay }
  3730.  
  3731. procedure PutPixelPlay;
  3732. { Demonstrate the PutPixel and GetPixel commands }
  3733. const
  3734.   Seed   = 1962; { A seed for the random number generator }
  3735.   NumPts = 2000; { The number of pixels plotted }
  3736.   Esc    = #27;
  3737. var
  3738.   I : word;
  3739.   X, Y, Color : word;
  3740.   XMax, YMax  : integer;
  3741.   ViewInfo    : ViewPortType;
  3742. begin
  3743.   MainWindow('PutPixel / GetPixel demonstration');
  3744.   StatusLine('Esc aborts or press a key...');
  3745.  
  3746.   GetViewSettings(ViewInfo);
  3747.   with ViewInfo do
  3748.   begin
  3749.     XMax := (x2-x1-1);
  3750.     YMax := (y2-y1-1);
  3751.   end;
  3752.  
  3753.   while not KeyPressed do
  3754.   begin
  3755.     { Plot random pixels }
  3756.     RandSeed := Seed;
  3757.     I := 0;
  3758.     while (not KeyPressed) and (I < NumPts) do
  3759.     begin
  3760.       Inc(I);
  3761.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  3762.     end;
  3763.  
  3764.     { Erase pixels }
  3765.     RandSeed := Seed;
  3766.     I := 0;
  3767.     while (not KeyPressed) and (I < NumPts) do
  3768.     begin
  3769.       Inc(I);
  3770.       X := Random(XMax)+1;
  3771.       Y := Random(YMax)+1;
  3772.       Color := GetPixel(X, Y);
  3773.         if Color = RandColor then
  3774.           PutPixel(X, Y, 0);
  3775.      end;
  3776.   end;
  3777.   WaitToGo;
  3778. end; { PutPixelPlay }
  3779.  
  3780. procedure PutImagePlay;
  3781. { Demonstrate the GetImage and PutImage commands }
  3782.  
  3783. const
  3784.   r  = 20;
  3785.   StartX = 100;
  3786.   StartY = 50;
  3787.  
  3788. var
  3789.   CurPort : ViewPortType;
  3790.  
  3791. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  3792. var
  3793.   Step : integer;
  3794. begin
  3795.   Step := Random(2*r);
  3796.   if Odd(Step) then
  3797.     Step := -Step;
  3798.   X := X + Step;
  3799.   Step := Random(r);
  3800.   if Odd(Step) then
  3801.     Step := -Step;
  3802.   Y := Y + Step;
  3803.  
  3804.   { Make saucer bounce off viewport walls }
  3805.   with CurPort do
  3806.   begin
  3807.     if (x1 + X + Width - 1 > x2) then
  3808.       X := x2-x1 - Width + 1
  3809.     else
  3810.       if (X < 0) then
  3811.         X := 0;
  3812.     if (y1 + Y + Height - 1 > y2) then
  3813.       Y := y2-y1 - Height + 1
  3814.     else
  3815.       if (Y < 0) then
  3816.         Y := 0;
  3817.   end;
  3818. end; { MoveSaucer }
  3819.  
  3820. var
  3821.   Pausetime : word;
  3822.   Saucer    : pointer;
  3823.   X, Y      : integer;
  3824.   ulx, uly  : word;
  3825.   lrx, lry  : word;
  3826.   Size      : word;
  3827.   I         : word;
  3828. begin
  3829.   ClearDevice;
  3830.   FullPort;
  3831.  
  3832.   { PaintScreen }
  3833.   ClearDevice;
  3834.   MainWindow('GetImage / PutImage Demonstration');
  3835.   StatusLine('Esc aborts or press a key...');
  3836.   GetViewSettings(CurPort);
  3837.  
  3838.   { DrawSaucer }
  3839.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  3840.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  3841.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  3842.   Circle(StartX+10, StartY-12, 2);
  3843.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  3844.   Circle(StartX-10, StartY-12, 2);
  3845.   SetFillStyle(SolidFill, MaxColor);
  3846.   FloodFill(StartX+1, StartY+4, GetColor);
  3847.  
  3848.   { ReadSaucerImage }
  3849.   ulx := StartX-(r+1);
  3850.   uly := StartY-14;
  3851.   lrx := StartX+(r+1);
  3852.   lry := StartY+(r div 3)+3;
  3853.  
  3854.   Size := ImageSize(ulx, uly, lrx, lry);
  3855.   GetMem(Saucer, Size);
  3856.   GetImage(ulx, uly, lrx, lry, Saucer^);
  3857. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  3858.  
  3859.   { Plot some "stars" }
  3860.   for I := 1 to 1000 do
  3861.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  3862.   X := MaxX div 2;
  3863.   Y := MaxY div 2;
  3864.   PauseTime := 70;
  3865.  
  3866.   { Move the saucer around }
  3867.   repeat
  3868. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  3869.      Delay(PauseTime);
  3870. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  3871.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  3872.   until KeyPressed;
  3873.   FreeMem(Saucer, size);
  3874.   WaitToGo;
  3875. end; { PutImagePlay }
  3876.  
  3877. procedure PolyPlay;
  3878. { Draw random polygons with random fill styles on the screen }
  3879. const
  3880.   MaxPts = 5;
  3881. type
  3882.   PolygonType = array[1..MaxPts] of PointType;
  3883. var
  3884.   Poly : PolygonType;
  3885.   I, Color : word;
  3886. begin
  3887.   MainWindow('FillPoly demonstration');
  3888.   StatusLine('Esc aborts or press a key...');
  3889.   repeat
  3890.     Color := RandColor;
  3891.     SetFillStyle(Random(11)+1, Color);
  3892.     SetColor(Color);
  3893.     for I := 1 to MaxPts do
  3894.       with Poly[I] do
  3895.       begin
  3896.         X := Random(MaxX);
  3897.         Y := Random(MaxY);
  3898.       end;
  3899.     FillPoly(MaxPts, Poly);
  3900.   until KeyPressed;
  3901.   WaitToGo;
  3902. end; { PolyPlay }
  3903.  
  3904. procedure FillStylePlay;
  3905. { Display all of the predefined fill styles available }
  3906. var
  3907.   Style    : word;
  3908.   Width    : word;
  3909.   Height   : word;
  3910.   X, Y     : word;
  3911.   I, J     : word;
  3912.   ViewInfo : ViewPortType;
  3913.  
  3914. procedure DrawBox(X, Y : word);
  3915. begin
  3916.   SetFillStyle(Style, MaxColor);
  3917.   with ViewInfo do
  3918.     Bar(X, Y, X+Width, Y+Height);
  3919.   Rectangle(X, Y, X+Width, Y+Height);
  3920.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  3921.   Inc(Style);
  3922. end; { DrawBox }
  3923.  
  3924. begin
  3925.   MainWindow('Pre-defined fill styles');
  3926.   GetViewSettings(ViewInfo);
  3927.   with ViewInfo do
  3928.   begin
  3929.     Width := 2 * ((x2+1) div 13);
  3930.     Height := 2 * ((y2-10) div 10);
  3931.   end;
  3932.   X := Width div 2;
  3933.   Y := Height div 2;
  3934.   Style := 0;
  3935.   for J := 1 to 3 do
  3936.   begin
  3937.     for I := 1 to 4 do
  3938.     begin
  3939.       DrawBox(X, Y);
  3940.       Inc(X, (Width div 2) * 3);
  3941.     end;
  3942.     X := Width div 2;
  3943.     Inc(Y, (Height div 2) * 3);
  3944.   end;
  3945.   SetTextJustify(LeftText, TopText);
  3946.   WaitToGo;
  3947. end; { FillStylePlay }
  3948.  
  3949. procedure FillPatternPlay;
  3950. { Display some user defined fill patterns }
  3951. const
  3952.   Patterns : array[0..11] of FillPatternType = (
  3953.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  3954.             OldColor which has a path of pixels of OldColor or NewColor
  3955.             with sides touching back to the seed point, (XSeed, YSeed).
  3956.             Therefore, only pixels of OldColor are modified and no other
  3957.             information is changed.
  3958.  
  3959.             SEE ALSO
  3960.  
  3961.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  3962.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  3963.             SETVIEW
  3964.  
  3965.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  3966.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  3967.             IF WHICHVGA = 0 THEN STOP
  3968.             DUMMY=RES640
  3969.             SETVIEW 100, 100, 539, 379
  3970.             FILLVIEW 10
  3971.             WHILE INKEY$ = ""
  3972.             WEND
  3973.             VIDEOMODESET VMODE
  3974.             END
  3975.  
  3976.  
  3977.  
  3978.  
  3979.  
  3980.  
  3981.  
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.                                                                          63
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.           FONTGETINFO
  3999.  
  4000.             PROTOTYPE
  4001.  
  4002.             SUB FONTGETINFO (Width%, Height%)
  4003.  
  4004.             INPUT
  4005.  
  4006.             no input parameters
  4007.     WEND
  4008.             MOUSEEXIT
  4009.             VIDEOMODESET VMODE
  4010.             END
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.  
  4034.  
  4035.  
  4036.  
  4037.  
  4038.  
  4039.  
  4040.  
  4041.  
  4042.  
  4043.  
  4044.  
  4045.  
  4046.  
  4047.  
  4048.  
  4049.  
  4050.  
  4051.                                                                          86
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.           MOUSECURSORDEFAULT
  4059.  
  4060.             PROTOTYPE
  4061.  
  4062.             SUB MOUSECURSORDEFAULT ()
  4063.  
  4064.             INPUT
  4065.  
  4066.             no input parameters
  4067.  
  4068.             OUTPUT
  4069.  
  4070.             no value returned
  4071.  
  4072.             USAGE
  4073.  
  4074.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  4075.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  4076. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  4077. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  4078. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  4079. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  4080. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  4081. $╤
  4082. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  4083. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  4084. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  4085. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  4086. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  4087. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  4088. ░£▒
  4089. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  4090. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  4091.       end;
  4092.     end;
  4093.   end;
  4094.   WaitToGo;
  4095. end; { UserLineStylePlay }
  4096.  
  4097.  
  4098. procedure SayGoodbye;
  4099. { Say goodbye and then exit the program }
  4100. var
  4101.   ViewInfo : ViewPortType;
  4102. begin
  4103.   MainWindow('');
  4104.   GetViewSettings(ViewInfo);
  4105.   SetTextStyle(TriplexFont, HorizDir, 4);
  4106.   SetTextJustify(CenterText, CenterText);
  4107.   with ViewInfo do
  4108.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  4109.   StatusLine('Press any key to quit...');
  4110.   repeat until KeyPressed;
  4111. end; { SayGoodbye }
  4112.  
  4113.  
  4114. PROCEDURE SelectMode;
  4115. VAR
  4116.     choice1,choice2     : CHAR;
  4117.    xsize,ysize            : WORD;
  4118. BEGIN
  4119.     (* Let's select a mode *)
  4120.     ClrScr;
  4121.     WriteLn('VESADEMO:');
  4122.     WriteLn('1. 256 colors');
  4123.     WriteLn('2. 32768 colors');
  4124.     WriteLn('3. 65536 colors');
  4125.     WriteLn('4. 16777216 colors');
  4126.     WriteLn('Q uit');
  4127.     WriteLn;
  4128.     Write('Your choice: ');
  4129.     REPEAT
  4130.         ReadLn(choice1);
  4131.       IF choice1 <> '1' THEN BEGIN
  4132.           WriteLn('Sorry !');
  4133.          WriteLn('This demo wasn''t written for more as 256 colors !');
  4134.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  4135.          WriteLn('Switching to 256 colors.');
  4136.          choice1 := '1';
  4137.       END;
  4138.     UNTIL choice1 IN ['1'..'4','q'];
  4139.     IF choice1 = 'q' THEN Halt;
  4140.  
  4141.     WriteLn;
  4142.     WriteLn;
  4143.     WriteLn('a. 320x200');
  4144.     WriteLn('b. 640x480');
  4145.     WriteLn('c. 800x600');
  4146.     WriteLn('d. 1024x768');
  4147.     WriteLn('e. 1280x1024');
  4148.     WriteLn('Q uit');
  4149.     WriteLn;
  4150.     Write('Your choice: ');
  4151.     REPEAT
  4152.         ReadLn(choice2);
  4153.     UNTIL choice2 IN ['a'..'e','q'];
  4154.     IF choice2 = 'q' THEN Halt;
  4155.  
  4156.     CASE choice2 OF
  4157.         'a' : BEGIN
  4158.